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

Weird one

Status
Not open for further replies.

jbrowne

Programmer
Feb 1, 2000
182
0
0
IE
Hi,

I have a wee problem. I am accessing an access 2000 database using VB6 thru the DAO object. One of my users is having problems in that the access database is not being closed on his machine when it should be. What happens is, I open the database, open the recordsets, transfer in the requires data, close the recordsets and close the database - then I rename the database. This is all done in the code but on my users machine it crashes out on the renaming of the database - the reason for this is that the database has not closed down properly (ie the .ldb file still exists in the directory) On my own machine with the same executable - this does not happen. Then when I close down the exe on the users machine - the database then closes fully (ie the .ldb file disappears) but there is no further close commands in the exe to do this. I hope this is clear - its a real odd-ball problem and I'm not sure where to go next to solve it. Is there a way to kill the db variable which is set to the database or am I on the wrong track altogether

Thanks in advance fo any help
John B
 
It does sound weird. Do you set your db value to nothing after you've closed it?

eg: Set db = Nothing

Don't actually exactly know myself what happens there, just something I've picked up in cleaning up my DB connections, recordsets, workspaces...

PS. For future reference try putting your problem in the title of your thread. You'll get more hits on the question, especially from those guru guys that really knows what they're talking about:)
 
Open the database & check under Tools -> Options; have a look on the Advanced tab for the "Default record locking" setting. If you know that there's no chance that 2+ users will try to access the database at the same time, you can set it to "No locks"; that should take care of the .ldb file (it's locking information). But things will get ugly in a hurry if users start stomping all over one another.
 
You might have to add a few seconds of buffer time between when you close the db and when you rename it.

Maybe the problem computer is running too slow with a PII or an old Celeron.

It could be that the rename routine is overlapping the close routine by a few milliseconds.
 
Thanks for your help folks but unfortunately none of these suggestions worked. I tried setting db = nothing (which I hadn't been doing) but that made no difference. I already had set the 'no locks' option in access - again no difference either way and the user is running on a top of the range P4 machine with buckets of memory so its not a slow machine problem. I'm at the wall with this one - any more suggestions - please !!

John B
 
It may help if you post the code where you manipulate the database (open, close, rename etc.)
 
Are you running the same office and os on both machines. An app I wrote had the same issue, and I discovered that my machine automatically closes the db before you call the same db again. Another machine, running older windows does not. Have you actually closed the db connecton using db.close?

BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top