user1455903
user1455903

Reputation: 21

Delphi 7 app using MSAccess database blocks access by MSaccess

I have an old Delphi 7 application that I fixed up a bit. It uses an Access database. There are about 150 users who all open the application remotely and access the database in parallel. Before I started fixing things (heh), this worked nicely (apart from bugs in the Delphi application), even if the database was occasionally a bit slow.

Now that I added a few features and two new tables I suddenly have really weird problems.

  1. MSAccess can access the Database (2010 version). This means: Double-clicking the file will open MSAccess and open the database file.
  2. The Delphi 7 app can access the database.
  3. Two or more instances of the Delphi app can share the database provided I change the original ConnectionString Mode from "ReadWrite" to "Share Deny None" (entire connection string below).
  4. Once an instance of the Delphi app is running, the database file cannot be opened any more by double-clicking it. (Nothing happens when I do this). However, I can open MSAccess and open the Database file from within it. That will work.

Connection String:

Provider=Microsoft.Jet.OLEDB.4.0;
User ID=Admin;Data Source=DBPath;
Mode=Share Deny None;
Extended Properties="";
Persist Security Info=False;
Jet OLEDB:System database="";
Jet OLEDB:Registry Path="";
Jet OLEDB:Database Password=****;
Jet OLEDB:Engine Type=5;
Jet OLEDB:Database Locking Mode=1;
Jet OLEDB:Global Partial Bulk Ops=2;
Jet OLEDB:Global Bulk Transactions=1;
Jet OLEDB:New Database Password="";
Jet OLEDB:Create System Database=False;
Jet OLEDB:Encrypt Database=False;
Jet OLEDB:Don`t Copy Locale on Compact=False;
Jet OLEDB:Compact Without Replica Repair=False;
Jet OLEDB:SFP=False

I still need to look at all the suggestions made by Renaud Bompuis about the security settings for the shares, but I'll have to unearth an Admin for this so it may take a while.

Upvotes: 2

Views: 1657

Answers (1)

Renaud Bompuis
Renaud Bompuis

Reputation: 16776

If you have a copy of the database on your machine, make sure that you can open it using Access without getting any error. Fix that first if you're getting issues. Maybe compact and repair the database.

Make sure that the remote folder you open the database from has been added to the list of Trusted Locations in Access (same for the local folder where you open your database from).

If you can open the database locally, but not when it's on a remote share, then make sure that the security settings for the shares allows you read and write access to the whole share so the database engine can properly create the .laccdb or .ldb lock file.
See question MS Access - “file already in use” error on split database for similar issues.

Basically, there is no reason for Access not to be able to open the remote database, even while other users are connected to it.

When you ask questions here, remember to post as much details as possible.
For instance here, you should post the exact connection string details you are using; you should also mention the exact error messages you are getting when trying to open the database from Access as it can help us identify the issue.

Upvotes: 1

Related Questions