PDA

View Full Version : URGENT: multiple users same DB gives error


x_goose_x
04-24-2003, 09:38 PM
I've got a VB app that a co-worker scripted for me that stores client info into an access DB. Whenever two people try to access the database at the same time I get a message saying that the database is in use by someone else. How can this be resolved? I figured the easiest way would be to make a queue for the db, but I don't know how to do this. Can anyone point me in the right direction?

Jason
04-24-2003, 10:52 PM
one idea might be to check and see what the error is that is going to come back when the DB is in use and instead of output that to the user have a "please wait" screen that will forward to the access screen eventually bu in the meantime continuously checks for the DB availability.


Jason

x_goose_x
04-24-2003, 11:17 PM
That's actually what I've started on, but figured there must be a better way.

smeagol
04-25-2003, 01:30 PM
Just my opinion, but I would say your coworker wrote the application using a SQL statement that's attempting to lock the database. He/she would have to change this part of the SQL statement and recompile in order to get the application to work like you are wanting.

As I said, just my opinion (for what it's worth).

khillabolt
04-30-2003, 07:29 PM
I'll assume that the app connects to the DB using ADO. In cases like this, it's usually the connection object isn't closed once the processing has been completed. You can look for the *.ldb file (a lock file that is created while Access has a database open), it will be in the same directory.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnado/html/msdn_workshp2.asp

An example:
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection

...Do stuff -> Recordsets, etc.

Conn.Close
Set Conn = nothing


Hope this helps...