Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cant close an ADO database
Message
De
10/09/2003 01:08:16
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Cant close an ADO database
Divers
Thread ID:
00827743
Message ID:
00827743
Vues:
58
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform