Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Trying To Open Non-Existent File - IMPOSSIBLE!

Status
Not open for further replies.

gharabed

Programmer
Sep 7, 2001
251
US
This is making me crazy! Does Access store paths to ADO connection objects internally someplace? Here's the situation:

1. I created an ADO connection to an external MDB file whose path is specified in a textbox (lets call it <origPath>) on a form (not hard-coded). I also create a local connection object via the (currentProject.connection method).

2. I move the external MDB file to another directory and delete the old path/directory.

3. I restart my app within Access and specify the new path (lets call it: <NewPath>)to the MDB file in the textbox.

Now when I try to open a query using a LOCAL connection I get an error (-2147467259) saying that the <origPath> doesn't exist! I never even specified <origPath>...where is it getting that from?
 
gharabed,
At the end of step 1, do you explicitly remove the connection object from the database? I think you may need to. I don't have any firsthand experience with this type of thing, but it's more than possible that connections to remote tables remain in Access until they are expressly deleted.

If that is the case, when trying to update the connection, it's looking to update a link that already exists, but is now pointing to nothing.

No solutions come to mind, except deleting the connections before deleting the source. That may or may not be feasible in your case.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top