473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Database not Found

The following block of code gives me an error.

MultiBD is my class for multiple databases.

connection= MultiBd.GetConnection(DataProviderType.OLEDB);
connection.ConnectionString = MultiBd.GetConnectionString
(1);
comand = connection.CreateCommand();
comand.CommandText = strSelectComand;
comand.CommandTimeout = 30;
adapter = MultiBd.GetDataAdapter(DataProviderType.OLEDB);
adapter.SelectCommand = comand;

connection.Open();
int numberOfRows = adapter.Fill(myDataSet);
connection.Close();

the connection string is as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\inetpub\\wwwroot\\tasks\\db\\db.mdb;Use r
Id=admin;Password=;

The database is there... But VS.NET gives me this error:
Could not find file 'C:\WINDOWS\SYSTEM32\db.mdb'.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
Could not find file 'C:\WINDOWS\SYSTEM32\db.mdb'.

Source Error:
Line 219:
Line 220: connection.Open();
Line 221: int numberOfRows = adapter.Fill(myDataSet);
Line 222: connection.Close();
Line 223: // }
Source File:
c:\inetpub\wwwroot\tasks\classes\db\dbinteraction. cs
Line: 221

Any help?

Thanx in advance
Bernardo Heynemann
Nov 18 '05 #1
4 2239
Apparently there is not "the" connection string. You stated that your
"MultiBd" class is a class for multiple databases, but you didn't post any
of its code, only stated that "the" copnnection string was what you stated
it was. However, the error indicates that the database location is different
from the location you specified in "the" connection string. Therefore, I
would have to guess that, as you stated that the "MultiBd" class is a class
for more than one database, that it defines more than one connection string,
and that it is returning the wrong one.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Bernardo Heynemann" <be******@bancobva.com.br> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
The following block of code gives me an error.

MultiBD is my class for multiple databases.

connection= MultiBd.GetConnection(DataProviderType.OLEDB);
connection.ConnectionString = MultiBd.GetConnectionString
(1);
comand = connection.CreateCommand();
comand.CommandText = strSelectComand;
comand.CommandTimeout = 30;
adapter = MultiBd.GetDataAdapter(DataProviderType.OLEDB);
adapter.SelectCommand = comand;

connection.Open();
int numberOfRows = adapter.Fill(myDataSet);
connection.Close();

the connection string is as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\inetpub\\wwwroot\\tasks\\db\\db.mdb;Use r
Id=admin;Password=;

The database is there... But VS.NET gives me this error:
Could not find file 'C:\WINDOWS\SYSTEM32\db.mdb'.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
Could not find file 'C:\WINDOWS\SYSTEM32\db.mdb'.

Source Error:
Line 219:
Line 220: connection.Open();
Line 221: int numberOfRows = adapter.Fill(myDataSet);
Line 222: connection.Close();
Line 223: // }
Source File:
c:\inetpub\wwwroot\tasks\classes\db\dbinteraction. cs
Line: 221

Any help?

Thanx in advance
Bernardo Heynemann

Nov 18 '05 #2
But I ran the application line by line and the connection string is that.
For sure.
The db opens fine, but when it tries to execute anything it gives me that
error.

Thanx,
Bernardo Heynemann
"Kevin Spencer" <ke***@takempis.com> escreveu na mensagem
news:eX**************@tk2msftngp13.phx.gbl...
Apparently there is not "the" connection string. You stated that your
"MultiBd" class is a class for multiple databases, but you didn't post any
of its code, only stated that "the" copnnection string was what you stated
it was. However, the error indicates that the database location is different from the location you specified in "the" connection string. Therefore, I
would have to guess that, as you stated that the "MultiBd" class is a class for more than one database, that it defines more than one connection string, and that it is returning the wrong one.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Bernardo Heynemann" <be******@bancobva.com.br> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
The following block of code gives me an error.

MultiBD is my class for multiple databases.

connection= MultiBd.GetConnection(DataProviderType.OLEDB);
connection.ConnectionString = MultiBd.GetConnectionString
(1);
comand = connection.CreateCommand();
comand.CommandText = strSelectComand;
comand.CommandTimeout = 30;
adapter = MultiBd.GetDataAdapter(DataProviderType.OLEDB);
adapter.SelectCommand = comand;

connection.Open();
int numberOfRows = adapter.Fill(myDataSet);
connection.Close();

the connection string is as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\inetpub\\wwwroot\\tasks\\db\\db.mdb;Use r
Id=admin;Password=;

The database is there... But VS.NET gives me this error:
Could not find file 'C:\WINDOWS\SYSTEM32\db.mdb'.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
Could not find file 'C:\WINDOWS\SYSTEM32\db.mdb'.

Source Error:
Line 219:
Line 220: connection.Open();
Line 221: int numberOfRows = adapter.Fill(myDataSet);
Line 222: connection.Close();
Line 223: // }
Source File:
c:\inetpub\wwwroot\tasks\classes\db\dbinteraction. cs
Line: 221

Any help?

Thanx in advance
Bernardo Heynemann


Nov 18 '05 #3
> But I ran the application line by line and the connection string is that.
For sure.
The db opens fine, but when it tries to execute anything it gives me that
error.
The db does NOT open fine. The error message indicates that the line
throwing the error is the line which attempts to open the Connection TO the
db. Furthermore, the error message indicates that the location it is looking
for the database in is not the location you specified as being in the
Connection String. Since the location of the database is DETERMINED by the
Connection String, it must not be using the Connection String you think it
is.

Without seeing the code for the class that is causing the problem, I can't
tell you anything more.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Bernardo Heynemann" <be******@bancobva.com.br> wrote in message
news:#U**************@TK2MSFTNGP12.phx.gbl... But I ran the application line by line and the connection string is that.
For sure.
The db opens fine, but when it tries to execute anything it gives me that
error.

Thanx,
Bernardo Heynemann
"Kevin Spencer" <ke***@takempis.com> escreveu na mensagem
news:eX**************@tk2msftngp13.phx.gbl...
Apparently there is not "the" connection string. You stated that your
"MultiBd" class is a class for multiple databases, but you didn't post any of its code, only stated that "the" copnnection string was what you stated it was. However, the error indicates that the database location is

different
from the location you specified in "the" connection string. Therefore, I
would have to guess that, as you stated that the "MultiBd" class is a

class
for more than one database, that it defines more than one connection

string,
and that it is returning the wrong one.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Bernardo Heynemann" <be******@bancobva.com.br> wrote in message
news:eo**************@TK2MSFTNGP09.phx.gbl...
The following block of code gives me an error.

MultiBD is my class for multiple databases.

connection= MultiBd.GetConnection(DataProviderType.OLEDB);
connection.ConnectionString = MultiBd.GetConnectionString
(1);
comand = connection.CreateCommand();
comand.CommandText = strSelectComand;
comand.CommandTimeout = 30;
adapter = MultiBd.GetDataAdapter(DataProviderType.OLEDB);
adapter.SelectCommand = comand;

connection.Open();
int numberOfRows = adapter.Fill(myDataSet);
connection.Close();

the connection string is as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\inetpub\\wwwroot\\tasks\\db\\db.mdb;Use r
Id=admin;Password=;

The database is there... But VS.NET gives me this error:
Could not find file 'C:\WINDOWS\SYSTEM32\db.mdb'.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and
where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
Could not find file 'C:\WINDOWS\SYSTEM32\db.mdb'.

Source Error:
Line 219:
Line 220: connection.Open();
Line 221: int numberOfRows = adapter.Fill(myDataSet);
Line 222: connection.Close();
Line 223: // }
Source File:
c:\inetpub\wwwroot\tasks\classes\db\dbinteraction. cs
Line: 221

Any help?

Thanx in advance
Bernardo Heynemann



Nov 18 '05 #4
I have to agree that there is a problem with the connection string. It
feels to me like c:\winnt\system32\db.mdb is the default database
(db.mdb) in the location where ADO executable is running. That's what
my gut says.

As to the cause, I wonder about the connection string. In particular
about the multiple slashes between each element in the path. I know, I
know, that how slashes are specified in C#. But I don't know where you
are finding the value of the connection string and I can't help
wondering if maybe the double slashes are not being interpreted the way
that you think they are.

Just my 2 cents.

Bruce Johnson
http://www.ObjectSharp.com/Bruce

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve Holden | last post by:
I'm trying to load module code from a database, which stores for each module its full name, code, load date and a Boolean indicating whether it's a package or not. The following simple program:...
3
by: TrvlOrm | last post by:
I am having great difficulty in these asp scripts, using VBscript and JavaScript. I have 4 files that all need to be linked together. The first file "Books.html" - needs to search for a Book...
14
by: L Mehl | last post by:
I tested a FE/BE application developed in A2000 on a A2002 machine and got this message when exiting the app. Clicking the only available button "OK", exits the application, as intended. The FE...
29
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this...
16
by: MLH | last post by:
If I give someone a runtime app, they can open the database window by pressing the F-11 key. How to prevent???
0
by: te goody | last post by:
Problem summary: Web Site Admin Tool is not generating the application services database (aspnetdb.mdf) in a SS 2005 only environment; i.e. The DB is not found under the app_data directory. The...
2
by: Anantha | last post by:
Dear All, One day our Windows 2000 Server OS crashed, so our NT admin has re-installed the OS on C: drive. Fortunately we kept our database file and installation in F: drive. When we...
6
by: Ted | last post by:
I am construvcting a number of databases, some of which contain sensitive data and most of which do not. I am attempting to handle the security issues involved in protecting sensitive data in part...
1
by: Ned Balzer | last post by:
Hi all, I have a problem that has me stumped. I developed an asp.net 2.0 application and it works fine. It is located in a subweb of a website, so for instance the main site is called...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.