Compact another DB within a Code

G

Guest

I try to use a DBEngine.compactdatabase:

'close DB to compact - (is not a current DB)
DBExt.Close
Const confilePath = "C:\CTRC\"

' Compact the database to a temp file.
DBEngine.CompactDatabase confilePath & "ABC.mdb", confilePath &
"ABCTEMP.mdb"

But I receved a error msg "Invalid argument"
Where is my mistake?
thank you
 
D

Dirk Goldgar

Mairim said:
I try to use a DBEngine.compactdatabase:

'close DB to compact - (is not a current DB)
DBExt.Close
Const confilePath = "C:\CTRC\"

' Compact the database to a temp file.
DBEngine.CompactDatabase confilePath & "ABC.mdb", confilePath &
"ABCTEMP.mdb"

But I receved a error msg "Invalid argument"
Where is my mistake?
thank you

The same code, modified for a test database of my own, works fine for
me. Are you sure the error is being raised on one of the lines you
posted?
 

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