Link to home
Start Free TrialLog in
Avatar of e1
e1

asked on

URGENT !!! Using 2 executables to access the same ".mdb" file

Dear Experts,

The situation is like this - I have written a server that keep track of some information (coming from the I/O port). This information is stored under an ".mdb" file - say "ABC.mdb"

Everything is fine until I want another executable to access "ABC.mdb" for informatin retrieval.

There will be an error message prompting "Cannot be updated : ABC.mdb is being locked by another program".
I guess this is because I am already using the server program to access the ".mdb" file and it will update the database whenever new information arrives.

I need your help and advices!!!!!
So how can I overcome this "locking" problem and fullfil the goal of constantly updating the file, while allowing information retrival at the "same time".
Any suggestions and comments are welcome. Your help is much appreciated.

As my customer is small business - so it would not be possible to provide them with a server solution (in business point of view).

Best Regards,
Eric
Avatar of _mb_
_mb_

How do you open the database? I think one of your executables (or both) opens the mdb-file using an exclusive mode.
Avatar of e1

ASKER

No, I did not use exclusive mode.
You said that your customer cannot afford a server solution but this is not quite true - if you are using Visual Studio to write your application then you have the write to distribute free MSDE (Microsoft data engine) with your application which is in fact the engine of SQL Server. You work with it the same way you work with SQL Server.

So probably you could think of this possibility
Avatar of e1

ASKER

Hi tchalkov,

If I am using Visual C++ 5.0 Professional Edition to develop my application and using the Microsoft Jet Database to perform different database operations previously, can I change my current project to use the Microsoft Data Enginer.

If yes, is there any example availiable?

Thanks!!!
It is free only for Visual Studio 6.0 Professional or Enterprise (for the whole suite , not only VC++)
more information you can get on www.microsoft.com/vstudio
Avatar of e1

ASKER

Thanks tchalkov.

My company has VC 5.0; so could not try the suggested MSDE. We are trying to figure out some other ways to overcome this problem.

But if there is no further comments coming at around Friday, then I will award the points to you for your help.

So if I could not use MSDE, do you have any better ideas?
ASKER CERTIFIED SOLUTION
Avatar of wraith0
wraith0

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of e1

ASKER

Finally we have solved the problem by catching the exception of "Update" - and retry to Update until it has successful OR it has failed for more than N times.

I would like to thank both wraith0 and tchalkov for their help. It seems, in this case, wraith0's solution is more appropriate (as I only have VC++ 5.0). So I would like to give the points to wraith0.

Thanks to both of you again.