Access File Lock

G

Guest

I am trying to run a simple VB.NET application using an Access 2000 database
as the OLEDB datasource directly from a CD. I have set the Locking mode =
read. When I autorun the application from the CD I get the error message
"Could not Lock File". When I run the same files from a folder on my USB Pen
Drive it works fine even when the Folder property is "Read-Only". I have
confirmed that no access.lockfile is created. Any ideas why it won't work
from a CD?

Thanks,
 
P

Paul Clement

¤ I am trying to run a simple VB.NET application using an Access 2000 database
¤ as the OLEDB datasource directly from a CD. I have set the Locking mode =
¤ read. When I autorun the application from the CD I get the error message
¤ "Could not Lock File". When I run the same files from a folder on my USB Pen
¤ Drive it works fine even when the Folder property is "Read-Only". I have
¤ confirmed that no access.lockfile is created. Any ideas why it won't work
¤ from a CD?

You might want to post your connection string so we can see what setting you are using for the Mode
parameter. If you're using a read-only device the parameter must be set correctly to prevent Jet
from attempting to create the corresponding .LDB file.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
G

Guest

Hi Paul,

My Connection String is:

OleDbConnection1.ConnectionString" value="Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking
Mode=1;Jet OLEDB:Database Password=;Data
Source="\ToysDB\Toys.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
Bulk
Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0";Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Read;Jet OLEDB:New
Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't
Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;User
ID=Admin;Jet OLEDB:Encrypt Database=False
 
P

Paul Clement

¤ Hi Paul,
¤
¤ My Connection String is:
¤
¤ OleDbConnection1.ConnectionString" value="Jet OLEDB:Global Partial Bulk
¤ Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking
¤ Mode=1;Jet OLEDB:Database Password=;Data
¤ Source="\ToysDB\Toys.mdb";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global
¤ Bulk
¤ Transactions=1;Provider="Microsoft.Jet.OLEDB.4.0";Jet OLEDB:System
¤ database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Read;Jet OLEDB:New
¤ Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't
¤ Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica
¤ Repair=False;User
¤ ID=Admin;Jet OLEDB:Encrypt Database=False

Try changing the Mode parameter to:

Mode=Share Exclusive


Paul
~~~~
Microsoft MVP (Visual Basic)
 
G

Guest

Hi Paul,

After a bit of experimenting

'Mode=Share Deny Write' worked.

My app now runs nicely from a CD.

Thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top