Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compacting an Access DB
Message
From
17/09/2003 14:25:45
 
 
To
All
General information
Forum:
Visual Basic
Category:
Other
Title:
Compacting an Access DB
Miscellaneous
Thread ID:
00830007
Message ID:
00830007
Views:
55
I am using the following code to open an access database. I cant seem to close it with the .Close command, so that I can compact it before exiting the program. Any ideas?

Dim WithEvents adoLogRS As Recordset

Form Load
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\DIVERS LOG TABLES.mdb;"
Set adoLogRS = New Recordset
adoLogRS.Open "select * from tblLOG", db, adOpenStatic, adLockOptimistic


Form Unload
adoLogRS.Close
Set adoLogRS = Nothing
db.Close
Set db = Nothing


***then comes the compact db routine, but it always fails, saying, cannot perform operation, database is already open.
Reply
Map
View

Click here to load this message in the networking platform