Solved

Strange connection problem

Posted on 2008-10-13
2
235 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now