在线管理数据库 类(12)


            Err.Clear
            RenameDBFile = False
        End If
        If DbExists(filespec1) THen
            call fso.CopyFile(filespec1,filespec2,True)
            call fso.DeleteFile(filespec1)
            RenameDBFile = True
        Else
            ErrMsg("源文件不存在!!!")
            RenameDBFile = False
            Exit Function
        End if
        Set fso = Nothing
    End function
    '压缩数据库
    Public Function CompactDBFile(strDBFileName)
        Dim Jet_Conn_Partial 
        Dim SourceConn
        Dim DestConn
        Dim oJetEngine
        Dim oFSO

        Jet_Conn_Partial = "Provider=Microsoft.Jet.OLEDB.4.0; Data source="

        SourceConn = Jet_Conn_Partial &  AppPath() &  strDBFileName
        DestConn = Jet_Conn_Partial &  AppPath() & "Temp" & strDBFileName
        Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
        Set oJetEngine = Server.CreateObject("JRO.JetEngine")

        With oFSO
            If Not .FileExists( AppPath() & strDBFileName) Then
                ErrMsg ("数据库文件未找到!!!!" )
                Stop
                CompactDBFile = False

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3518.html