Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / April 2006

Tip: Looking for answers? Try searching our database.

Access File Lock

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Geoff Murley - 25 Apr 2006 12:01 GMT
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,
Paul Clement - 25 Apr 2006 13:11 GMT
¤ 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)
Geoff Murley - 25 Apr 2006 15:51 GMT
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

> ¤ 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 =
[quoted text clipped - 11 lines]
> ~~~~
> Microsoft MVP (Visual Basic)
Paul Clement - 27 Apr 2006 13:09 GMT
¤ 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)
Geoff Murley - 28 Apr 2006 11:44 GMT
Hi Paul,

After a bit of experimenting

'Mode=Share Deny Write' worked.

My app now runs nicely from a CD.

Thanks for your help.

> ¤ Hi Paul,
> ¤
[quoted text clipped - 19 lines]
> ~~~~
> Microsoft MVP (Visual Basic)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.