Languages :: Visual Basic :: VB6 already opened exclusively / could not lock - errors - Access |
|||
| By: alyonsal |
Date: 01/03/2010 23:25:33 |
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 | Type : Comment |
|
| is machine "WIN-R0EXOH5BPU9" yours ? | |||
| By: alyonsal | Date: 05/03/2010 11:55:35 | 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 | 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 |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








