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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Data Control, Refresh Method, and ldb file

Status
Not open for further replies.

vladk

Programmer
May 1, 2001
991
US
Hi,

I am maintaining the old application that uses Microsoft ADO Data Control. I noticed, that when the application ends, it always leaves ldb file, which is not I would expect.

I researched the code and found that ADODC Refresh method creates the ldb record-locking file. I tried to play with various properties and methods of that control but could not get rid of the ldb file.


Can anyboby help me find out how to remove the locks after the Refresh so when the program ends, only mdb file would remain.

Thank you!

vladk
 
The ldb file is created by the Access installation, not the program. When you close out Access, the ldb should delete itself.

I have great faith in fools; self-confidence my friends call it.
-Poe
 
genomon,

Thanks for the reply. I meant, ldb file appears when line with Refresh method executed. Access appears to be closed after the program's end but the ldb file still persists in the directory. And if it was not closed, how would I know which instance of Access to close in case there are several of them?

vladk

 
This is a guess, but, are you using ADO to create the connection to the database, and if so, are you closing the connection after getting your data?
 
vladk,

Your users do have delete rights on that folder, don't they?
A connection opens, an ldb is created. When ALL connections to that mdb close, ldb is automatically deleted. Opening that access with MSAccess.exe, opens a connection - workspace.
 
Hi guys,

Yes, this application uses ADODB.Connection. It indeed closes and sets to Nothing the connection. But this line:
adoLookup.Refresh '(adoLookup is ADODC)
either opens or reopens database that leads to the ldb file.

I found some kind of solution: I added these lines in UserForm_QueryClose event:

adoLookup.Recordset.Close
Set adoLookup.Recordset = Nothing

It eliminates the ldb file, but the latter line causes this message:

"Data source name not found and no default driver specified."

I believe, something should be adjusted in my PC regarding DNS settings to get rid of this message. But the additional problem is that this application is in use by many people, which do have delete rights on that folder, but not necessarily have the proper DNS settings.

Thanks

vladk

vladk
 
I don't think this line is accepted
Set adoLookup.Recordset = Nothing

But ... I don't use that ADODC any more since the 1st time I did. [wink]
 
Well, I don't like this line either. But I need somehow negate that Refresh. ADODC is something that is given to support...
 
I solved it:

adoLookup.Recordset.ActiveConnection.Close

vladk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top