Solved

Strange connection problem

Posted on 2008-10-13
2
238 Views
Last Modified: 2013-12-17
There are 2 Access databases, and user chooses to which database to connect to. Now, When connected to database1, everyting works well. When connected to database2, I get following exception:

c:\SomePreviousDatabasePath\database2.mdb is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

Now, the message is very precise, but the problem is I dont use this path anywhere in connection string. What is even more strange, the connection opens without any errors.

myCommand.Connection.Open(); // no exception raised here
OleDbDataReader dr = myCommand.ExecuteReader(); // this line throws exception

MyCommand.CommandText doesnt have any database pats in it, just a reguler SELECT somefields FROM tableName WHERE some condition

Has anyone had this problem before?

Thanks,
Goran
0
Comment
Question by:Priest04
2 Comments
 
LVL 8

Accepted Solution

by:
mkosbie earned 500 total points
ID: 22707408
Is the mdb file setup with linked tables maybe?  Are the tables linked from a datasource that no longer exists?
0
 
LVL 18

Author Comment

by:Priest04
ID: 22707753
:) ccccc....... Yes, there were some linked tables, although I don't use them, I have added them few days ago just for some testing purpose, and forgot to remove them. I am so filled with work, that I feel all lost. :)

Thanks mkosbie, much appreciated.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question