Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Strange connection problem

Posted on 2008-10-13
2
Medium Priority
?
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
mkosbie earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

598 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