Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DISCONNECTING ACCESS DB

Status
Not open for further replies.

hbez

Instructor
Mar 25, 2003
49
ZA
Is there a way to force an Access DB to close so I can erase the thing from my app? I have closed all ADOConnections, made all ADOTables and ADOQueries inactive, and closed all DataSets, however, the ldb file remains - I cannot erase the mdb file!
When creating a new DB, I use
ADOXCatalog1.Disconnect;
ADOXCatalog1.Create1(DataSource);
The error is triggered by this last statement since the DB already exists.
Many thaks for help on this one.
Hannes
 
Just to wrap this one up: After reading the database, I did such things as qryData.Active := False, closed datasets, etc, all to no avail. What did work was to make the ConnectionString := ''; as well. This closed the .ldb file.
Hannes
 
I must say that in my days of using the TADOConnection, I never needed to actually set the connection string like that.
All I did was make sure that the tables.active := false, and that the KeepConnected proprty of the ADOConnection was set to False (before compiling and running).

Interesting problem here. Which version of Delphi are you using?

~
“Your request is not unlike your lower intestine: stinky, and loaded with danger.” — Ace Ventura.
 
Thanks for that, in truth, I never set the KeepConnection to False. Matter of fact, I completely missed that property! Tried it and it also works fine. :)
I use Delphi 7 Enterprise.

Hannes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top