473,323 Members | 1,560 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,323 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 15 '05 #1
3 1894
Hi Bernardo,

It looks to me like connection is using wrong connection string.
I suggest you to check it with debugger.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

"Bernardo Heynemann" <be******@bancobva.com.br> wrote in message
news:OQ****************@TK2MSFTNGP11.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 15 '05 #2
I did check and the connection string is for sure the following...
And I tried running the app in my friend´s VS.net and the error was the same
but the directory it tried to access was:
c:\inetpub\wwwroot\tasks\bin\debug\db.mdb

How can the same app try to access the database in two different
locations???

Thanx
Bernardo Heynemann
"Miha Markic" <miha at rthand com> escreveu na mensagem
news:uh**************@TK2MSFTNGP12.phx.gbl...
Hi Bernardo,

It looks to me like connection is using wrong connection string.
I suggest you to check it with debugger.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

"Bernardo Heynemann" <be******@bancobva.com.br> wrote in message
news:OQ****************@TK2MSFTNGP11.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 15 '05 #3
hi, i have the same problem and im sorry i cant help.
please tell me if you solve the problem.
thank you
From http://www.developmentnow.com/g/36_2...-not-found.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Nov 17 '05 #4

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:...
4
by: Andy Lee | last post by:
Hi I have a bit of code which executes an SQL statement.on my webpage. If the execution fails i do not want a standard error coming up that asp normally shows - instead i would like something...
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...
0
by: electrical | last post by:
/** Database implements a database of records */ public class Database { private Record base; // the collection of records private int NOT_FOUND = -1; // int used to denote when a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.