visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: Visual Basic :: VB6 already opened exclusively / could not lock - errors - Access


By: alyonsal Great Britain  Date: 01/03/2010 23:25:33  English  Points: 20 Status: Open
I am using VB6 application which connects to an Access database as follows: connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SystemPath & "\" & Table & ".mdb;Mode=ReadWrite;Persist Security Info=False" Once finished I always close: If rs.State And adStateOpen Then rs.Close cn.Close Set cn = Nothing Set rs = Nothing However I regular get the following messsage on the machine where the database are located - this is a multi user enviroment. You attempted to open a database that is already opened exclusively by user Admin on machine WIN-R0EXOH5BPU9. Try again when the database is available. I have ensured that the default mode is shared, and the default locking is no lock. However it still works on more regular this error occurs. Mostly when there are no other users on the system, just the processes that ran on the server, one instance at a time."



Optional Information:
Computer OS: Windows Vista
Browser: IE
Programming Language: VB6
Compiler: VB6

Already Tried:
ensuring connections closed and checking access options for default locking
By: VGR Date: 05/03/2010 11:27:26 English  Type : Comment
is machine "WIN-R0EXOH5BPU9" yours ?
By: alyonsal Date: 05/03/2010 11:55:35 English  Type : Comment
The access database is on that machine, and most of the errors occur on that one.

However I also get cant lock or cant update on other PCs too. Doesnt happen all time, just sometimes?

Thanks,
Ally
By: VGR Date: 09/03/2010 08:06:54 English  Type : Comment
I see two tracks to explore :
1) Access has a limited number of available connections and you exceeded it (like MSDE which has 10 only)
2) or the SYSTEM user on the DB host needs some time before it can accept your cn.Close or rs.Close, probably because it is either closing others' connections or because it takes time to close your open resources (datasets, connections etc) before the closing is complete.

you could probably wait before exiting (like a sleep(1) ) so that the DB process (a service, most probably) has the time to perform the closing before answering.

Your code is non-blocking and this could be the cause.

Do register to be able to answer

EContact
browser fav
page generated in 298.888920 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page