//<CSCM>
        //********************************************************************************
        //** 函 数 名: GetPDBOrGDBWorkspace
        //** 版    权: CopyRight (C)
        //** 创 建 人: 杨旭斌
        //** 功能描述: 根据用户提供的PDB的全路径,获得对应的MDB的工作空间
        //** 创建日期:
        //** 修 改 人:
        //** 修改日期:
        //** 修改时间: 20070818
        //** 参数列表: sPDBOrFDBRouteAndName (String)pdb或FDB的全路径,即包括文件名称
        //**           bCreateFDB标识是否是创建FDB
        //** 版    本:1.0
        //*********************************************************************************
        //</CSCM>
        public static IWorkspace GetPDBOrGDBWorkspace(string sPDBOrFDBRouteAndName, bool bCreateFDB)
        {
            IWorkspace functionReturnValue = default(IWorkspace);

            try
            {
                string            sFilePath = null;
                string            sFileName = null;
                IWorkspaceFactory pWorkspaceFactory;
                IWorkspace        pWorkspace = default(IWorkspace);



                if (string.IsNullOrEmpty(Strings.Trim(sPDBOrFDBRouteAndName)))
                {
                    functionReturnValue = null;
                    return(functionReturnValue);
                }

                if (bCreateFDB)
                {
                    pWorkspaceFactory = new FileGDBWorkspaceFactoryClass();
                }
                else
                {
                    pWorkspaceFactory = new AccessWorkspaceFactoryClass();
                }

                //获得文件名
                sFileName = Microsoft.VisualBasic.FileIO.FileSystem.GetName(sPDBOrFDBRouteAndName);
                //20110723  HSh 注释因为文件名称未加后缀名".gdb"而不能创建的问题
                sFileName = sFileName.Substring(0, sFileName.Length - 4);

                //获得路径
                sFilePath = Microsoft.VisualBasic.FileIO.FileSystem.GetParentPath(sPDBOrFDBRouteAndName);
                //如果路径不存在,则创建
                if (Microsoft.VisualBasic.FileIO.FileSystem.DirectoryExists(sFilePath) == false)
                {
                    Microsoft.VisualBasic.FileIO.FileSystem.CreateDirectory(sFilePath);
                }
                //判断MDB文件是否存在,如果不存在的话,则创建
                if (bCreateFDB == false)
                {
                    if (Microsoft.VisualBasic.FileIO.FileSystem.FileExists(sPDBOrFDBRouteAndName) == false)
                    {
                        pWorkspaceFactory.Create(sFilePath, sFileName, null, 0);
                    }
                }
                else
                {
                    if (Microsoft.VisualBasic.FileIO.FileSystem.DirectoryExists(sPDBOrFDBRouteAndName) == false)
                    {
                        pWorkspaceFactory.Create(sFilePath, sFileName, null, 0);
                    }
                }
                pWorkspace = pWorkspaceFactory.OpenFromFile(sPDBOrFDBRouteAndName, 0);

                ClsPublicFunction.DeleteAllFeatCls(pWorkspace);

                functionReturnValue = pWorkspace;
                return(functionReturnValue);
            }
            catch
            {
                functionReturnValue = null;
                return(functionReturnValue);
            }
        }