Problem opening ADO connection to database on a CDROM 
Author Message
 Problem opening ADO connection to database on a CDROM

When opening an MSAccess database through ADO on a CDROM, an attempt to open
a lock (mydb.ldb) file on the CDROM is made, generating an error.  Obviously
this is because you cant write to a CDROM.

I was wondering is there any way of specifying an alternative location for
the lock file or to stop ADO from creating it in the first place.  I have
tried several methods including opening the database in adReadOnly mode, and
adShareDenyWrite, and these methods still create the problem of the lock
file.

Has anyone got any suggestions, this is quite urgent.



Tue, 26 Nov 2002 03:00:00 GMT  
 Problem opening ADO connection to database on a CDROM

Quote:
> When opening an MSAccess database through ADO on a CDROM, an attempt to
open
> a lock (mydb.ldb) file on the CDROM is made, generating an error.
Obviously
> this is because you cant write to a CDROM.

> I was wondering is there any way of specifying an alternative location for
> the lock file or to stop ADO from creating it in the first place.  I have
> tried several methods including opening the database in adReadOnly mode,
and
> adShareDenyWrite, and these methods still create the problem of the lock
> file.

> Has anyone got any suggestions, this is quite urgent.

With DAO there were always 2 approaches:
1. open read only and put a copy of the ldb on the CD when you burn it
2. open exclusive read-only

I haven't tried either with ADO



Tue, 26 Nov 2002 03:00:00 GMT  
 Problem opening ADO connection to database on a CDROM


Quote:


> > When opening an MSAccess database through ADO on a CDROM, an attempt to
> open
> > a lock (mydb.ldb) file on the CDROM is made, generating an error.
> Obviously
> > this is because you cant write to a CDROM.

> > I was wondering is there any way of specifying an alternative location
for
> > the lock file or to stop ADO from creating it in the first place.  I
have
> > tried several methods including opening the database in adReadOnly mode,
> and
> > adShareDenyWrite, and these methods still create the problem of the lock
> > file.

> > Has anyone got any suggestions, this is quite urgent.

> With DAO there were always 2 approaches:
> 1. open read only and put a copy of the ldb on the CD when you burn it
> 2. open exclusive read-only

> I haven't tried either with ADO

Ill try the copy of ldb on the cd but read only doesnt work

Thanks



Tue, 26 Nov 2002 03:00:00 GMT  
 Problem opening ADO connection to database on a CDROM

Quote:





> > > When opening an MSAccess database through ADO on a CDROM, an attempt
to
> > open
> > > a lock (mydb.ldb) file on the CDROM is made, generating an error.
> > Obviously
> > > this is because you cant write to a CDROM.

> > > I was wondering is there any way of specifying an alternative location
> for
> > > the lock file or to stop ADO from creating it in the first place.  I
> have
> > > tried several methods including opening the database in adReadOnly
mode,
> > and
> > > adShareDenyWrite, and these methods still create the problem of the
lock
> > > file.

> > > Has anyone got any suggestions, this is quite urgent.

> > With DAO there were always 2 approaches:
> > 1. open read only and put a copy of the ldb on the CD when you burn it
> > 2. open exclusive read-only

> > I haven't tried either with ADO

> Ill try the copy of ldb on the cd but read only doesnt work

  In DAO, it is essential that the mdb on CD is opened with exclusive = True
*and* Read-only = True.  In ADO, wouldn't the corresponding approach be to
set the Connection's Mode property to adModeShareExclusive + adModeRead?  I
don't have VB at this computer to test it, but see
http://msdn.microsoft.com/library/psdk/dasdk/mdap57qd.htm and
http://msdn.microsoft.com/library/techart/daotoadoupdate_topic4.htm for more
documentation.  Please post specifics if you try this combination
successfully.  MSDN doesn't seem to offer an example of "opening an Access
mdb on CD"


Tue, 26 Nov 2002 03:00:00 GMT  
 Problem opening ADO connection to database on a CDROM
You might already be doing this but here's a tip:
Instead of burning a CD every time that you want to test out your program,
you can just turn on the Read-Only attributes for the MDB and the LDB files.


Quote:
> When opening an MSAccess database through ADO on a CDROM, an attempt to
open
> a lock (mydb.ldb) file on the CDROM is made, generating an error.
Obviously
> this is because you cant write to a CDROM.

> I was wondering is there any way of specifying an alternative location for
> the lock file or to stop ADO from creating it in the first place.  I have
> tried several methods including opening the database in adReadOnly mode,
and
> adShareDenyWrite, and these methods still create the problem of the lock
> file.

> Has anyone got any suggestions, this is quite urgent.



Wed, 27 Nov 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Problem opening ADO connection to database on a CDROM

2. ADO Database connection open or closed?

3. Opening an Access database with ADO connection and VBScript

4. When to open ADO Database Connection

5. When to open ADO Database Connection

6. Runtime Access97 wont open database on CDROM

7. Problem to open a connection with ADO

8. Problem syncronising two ADO Connections to an Access 97 database

9. database connection remain open if opened via recordset

10. Connection Problem - ado failover connection

11. VB6: Problem sharing ADO connection between COM Objects (complex problem)

12. Problem sharing ADO connection between COM Objects (complex problem)

 

 
Powered by phpBB® Forum Software