File already in use. Not really!

reburton

Registered User.
Local time
Today, 05:41
Joined
Nov 4, 2013
Messages
46
Hi,
I have a problem with making an ADO connection. Access raises an error saying that my file is already in use. It is not. What could cause that?
Here is a screen shot of the error with the code in the background. It is choking on the line:
cnADO.Open strConnection
The screenshot:
FileInuse.jpg
Help!?!?
 
Last edited:
WHat is the full path of the file from which you execute the code?
 
C:\Users\OBBurton\Documents\ADOExamples.accdb
 
So you are linking the file to itself, so how do you arrive at "Not really?") :)
 
Thanks,
I mean that the error message implies someone or something else has it open. Why would it throw an error about having the file open?
 
There are multiple ways of opening an ado connection, esepcially to current db. I don't use ADO so I don't know how to in your case. Google would yield an answer in 2 minutes.

If you do not have any specifics requiring ADO then drop it and use DAO. Rather simpler, IMHO.
 
I think it is what you are using for the connection. If you are connecting to the database where your code is located, the code should be:

Set cnADO = CurrentProject.Connection
 
Thanks again! To spikepl, I am learning over and over again (it takes a lot of repetition for us knuckleheads) about the power of Google. I'm sure part of the problem is my underlying hatred for the company. Just the company, mind you not the search engine, I won't use any other. :o
 

Users who are viewing this thread

Back
Top Bottom