G
Guest
I am using the following code to compact Database A while in Database B.
Dim strTmp As String
Dim strPath As String
Dim strFile As String
Dim strFull As String
' Lookup the path and database to set up as the template
' Path
strPath = DLookup("[ExportDirectory]", "tblMaster", "[MasterID] = 1")
' Database
strFile = DLookup("[ExportTemplateDatabase]", "tblMaster", "[MasterID] = 1")
' Full path and name
strFull = strPath & strFile
strTmp = Trim(strFull)
strTmp = Left(strTmp, Len(strTmp) - 4)
strTmp = strTmp & "BAK.mdb"
' Compact the database into a temporary database.
DBEngine.CompactDatabase strFull, strTmp
Kill strFull
Name strTmp As strFull
This code does not work. Can anyone tell me why it doesn't work or what I am
doing wrong?
Dim strTmp As String
Dim strPath As String
Dim strFile As String
Dim strFull As String
' Lookup the path and database to set up as the template
' Path
strPath = DLookup("[ExportDirectory]", "tblMaster", "[MasterID] = 1")
' Database
strFile = DLookup("[ExportTemplateDatabase]", "tblMaster", "[MasterID] = 1")
' Full path and name
strFull = strPath & strFile
strTmp = Trim(strFull)
strTmp = Left(strTmp, Len(strTmp) - 4)
strTmp = strTmp & "BAK.mdb"
' Compact the database into a temporary database.
DBEngine.CompactDatabase strFull, strTmp
Kill strFull
Name strTmp As strFull
This code does not work. Can anyone tell me why it doesn't work or what I am
doing wrong?