compress and repair in code

G

Guest

Hi i have this code (some of it)
Function ExportToSecuredDB()

Dim strDestinationMDB As String
Dim dbsData As DAO.Database
strDestinationMDB = "\\server\pcg\pcg.mdb"
Set dbsData = DBEngine.OpenDatabase(strDestinationMDB, _
False, False, ";pwd=PannNuka1234")
'Export form
'DoCmd.CopyObject strDestinationMDB, "kunder", acForm, "Kunder"
'Export table
DoCmd.TransferDatabase acExport, _
"Microsoft Access", _
strDestinationMDB, _
acTable, _
"kunder", _
"kunder"
'Close secured database
dbsData.Close
Set dbsData = Nothing
End Function

Where i copy som table from one db to another db
its working allright.
But the Db there get the new table \\server\pcg\pcg.mdb
are 4mb big before i copy and 8mb big after i copy
so is there away in code to compress and repair \\server\pcg\pcg.mdb
from another Db??? like the one here i'm in?

Regards
alvin
 
G

Guest

Hi Alex
Thanks
Maybe you can help with the string
the db has also a password and i use this to connect me to it.

strDestinationMDB = "\\server\pcg\pcg.mdb"
Set dbsData = DBEngine.OpenDatabase(strDestinationMDB, _
False, False, ";pwd=PannNuka1234")

So how do i write the string, i have try with
DBEngine.CompactDatabase ("\\server\pcg\pcg.mdb")
but get an error

regards
alvin



"Alex Dybenko" skrev:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top