 |
 |

10-17-2003, 03:23 AM
|
|
Newcomer
|
|
Join Date: Oct 2003
Posts: 4
|
|
Database access with 2 applications at the same time
|
Well here again is my problem:
I have 2 identical aplications, that have access
to the same database (lets say Northwind.mdb).
When I'm trying to access to the database with both
applications one of them generates an error. I'm trying
to solve this problem so, that the second
application will wait and then access the base when the first will
finished. I don't have a clue how to do this. Can you help me please?
Thanks,
Jani
|
|

10-17-2003, 03:29 AM
|
|
Steppe Walker
Retired Moderator * Expert *
|
|
Join Date: Jul 2002
Location: Ukraine/Russia/Belgium
Posts: 7,227
|
|
|
Hi,
It woud be nice to know what kind of error you are getting.
In general to see whether the database is already opened by another user you could check for the .ldb file which is generated when someone opens the .mdb file.
|
|

10-17-2003, 03:32 AM
|
 |
Senior Contributor
|
|
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
|
|
An idea
|
You could open the adocd, give the values of the fields to the textboxes, combos, etc, and close the connection, and when you update or add new values, return to open the connection, save it and close again the connection.
When you re-open the connection, i think you could test if the database is being using by other application using the On error procedure ...
Is only an idea, 'cos I made something like this time ago ... but that doesn't have to mean that it is a good idea.
|
|

10-17-2003, 03:42 AM
|
|
Newcomer
|
|
Join Date: Oct 2003
Posts: 4
|
|
Quote: Originally Posted by Shurik12 Hi,
It woud be nice to know what kind of error you are getting.
In general to see whether the database is already opened by another user you could check for the .ldb file which is generated when someone opens the .mdb file.
Hi! Thanks for reply. Im getting this error:
"Run-time error '3356':
You attempted to open a database that is already opened exclusively by user 'admin' in machine 'W05'. Try again when the database is avaliable"
Well, I completly understand the problem. What I don't know is: How to tell the application to "wait for 2nd to finish with accessing the database"??
|
|

10-17-2003, 04:00 AM
|
|
Centurion
|
|
Join Date: Aug 2003
Posts: 134
|
|
Quote: Originally Posted by janigorse
Hi! Thanks for reply. Im getting this error:
"Run-time error '3356':
You attempted to open a database that is already opened exclusively by user 'admin' in machine 'W05'. Try again when the database is avaliable"
Well, I completly understand the problem. What I don't know is: How to tell the application to "wait for 2nd to finish with accessing the database"??
peperl allready gave u this option, Use an disconnected recordset. Or get a databace program that allows multiple users.
|
__________________
!!! The smaller the mistake, The bigger the problem !!!
!!! When the end is near, embrace it..Why sufer if it isn't nessecery !!!
|

10-17-2003, 04:16 AM
|
|
Newcomer
|
|
Join Date: Oct 2003
Posts: 4
|
|
Quote: Originally Posted by irri
Or get a databace program that allows multiple users.
Well here is the catch! I only need 1 user to access at the same time. I just want to acomplished that one application wait. And I really don't have a clue how to do it. Thats it! Thanks guys!
|
|

10-17-2003, 04:46 AM
|
|
Centurion
|
|
Join Date: Aug 2003
Posts: 134
|
|
Quote: Originally Posted by janigorse
Quote: Originally Posted by irri
Or get a databace program that allows multiple users.
Well here is the catch! I only need 1 user to access at the same time. I just want to acomplished that one application wait. And I really don't have a clue how to do it. Thats it! Thanks guys!
there is a windows api call which waits until a pid is done (processor id), you could use that for your application.
|
__________________
!!! The smaller the mistake, The bigger the problem !!!
!!! When the end is near, embrace it..Why sufer if it isn't nessecery !!!
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|