Access mdb file from cd?

i want to connect to a mdb (microsoft Access database) from CD drive by ADO Connection.
but ADO create an exception(can not create lock file). i think that Access wants to create an temporary file (*.ldb) and because the main file (*.mdb) is on CD dirve it can not.
so how can i prevent ADO from creating this temp file (*.ldb) or change locatine to a place other than CD drive?
Thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mohammed NasmanSoftware DeveloperCommented:

Set the connection mode to ShareExclusive

ADOConnection1.Mode := cmShareExclusive;


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hi I think the problem is that the file on the CD is read-only .'. you cannot write back to it, and neither can Access :( I would suggest copying it from the CD to a temp folder, set it so its not read only and then reading it (dont forget to delete it again when your finished) cheap nasty but it should work ;-p)

Just a suggestion.

Create a database locally on your C: drive and either link the tables on your CD or import the tables.

Do a test by opening the mdb with MSAccess/ and /or linling the tables - this will give you some clues.

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

good idea,

if that works properly then the only differenace will be that thw file on CD is read-only ... so .'. try copying it off making it not real-only and then using it

I feel that I aught to get some points here, the file was almost certainly read only and so could not be accessed normaly


Mohammed NasmanSoftware DeveloperCommented:
points to me
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.