p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   ADO.NET (http://p2p.wrox.com/ado-net-109/)
-   -   Error with ASP.NET opening OleDb/ODBC database (http://p2p.wrox.com/ado-net/1681-error-asp-net-opening-oledb-odbc-database.html)

gdelia1 July 15th, 2003 11:54 AM

Error with ASP.NET opening OleDb/ODBC database
 
Hi there,

I got a problem using an MS Access database through ASP.NET.

After updating my system from .NET Framework 1.0 to 1.1, my existing
application gives me the following error when opening a connection
with the code below:

"Unspecified error" (ErrorCode: -2147467259)

string connectionStringKey = "LocalDBConnectionString";
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\InetPub\wwwroot\IS_Italy_2003\IS.mdb";

OdbcConnection connection = new OdbcConnection(connectionString);
try
{
connection.Open();
}
catch (OdbcException ex)
{
string error = ex.Message;
}
finally
{
connection.Close();
}

What's really strange is that:
1. The same application works on some of my colleagues' computers with
the .net Framework 1.1
2. The very same code works on my computer when creating a brand new
application with VS.NET 2003
3. The same application was working with .NET Framework 1.0

The same thing happens (including the two cases above) when using ODBC
classes instead of OleDB ones. In this case the connection string is:

"FIL=MS Access;DSN=AIS_Local"

and the error is:

"ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Disk or
network error.\r\nERROR [IM006] [Microsoft][ODBC Driver Manager]
Driver's SQLSetConnectAttr failed\r\nERROR [HY000] [Microsoft][ODBC
Microsoft Access Driver] Disk or network error."

Need HELP!!!
tks


sdrom July 19th, 2003 01:50 PM

when I do following

 Console.WriteLine("hello\hello");
I see just hellohello
but I do Like this
 Console.WriteLine("hello\\hello");
I see what I was going to , there is another way to do the
same but I never use it(and could be wrong)
Console.WriteLine(@"hello\hello")
 ___________________
P.S. Check Your Connection_String


kasie July 24th, 2003 04:15 PM

I believe your connection string is not correct, the one you have is the OLE connection NOT ODBC, try this,
string connectionstring=@"Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\InetPub\wwwroot\IS_Italy_2003\IS.m db";
If you have the ODBC.Net online help avail type on index for "connectionstring"

Good luck [^]
Kasie


r.cicca May 26th, 2004 07:35 AM

I had the same exactly problem and today I didn't found a solution.
Do you had found a solution?
Thanks,
Roberto

Quote:

quote:Originally posted by gdelia1
 Hi there,

I got a problem using an MS Access database through ASP.NET.

After updating my system from .NET Framework 1.0 to 1.1, my existing
application gives me the following error when opening a connection
with the code below:

"Unspecified error" (ErrorCode: -2147467259)

string connectionStringKey = "LocalDBConnectionString";
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\InetPub\wwwroot\IS_Italy_2003\IS.mdb";

OdbcConnection connection = new OdbcConnection(connectionString);
try
{
connection.Open();
}
catch (OdbcException ex)
{
string error = ex.Message;
}
finally
{
connection.Close();
}

What's really strange is that:
1. The same application works on some of my colleagues' computers with
the .net Framework 1.1
2. The very same code works on my computer when creating a brand new
application with VS.NET 2003
3. The same application was working with .NET Framework 1.0

The same thing happens (including the two cases above) when using ODBC
classes instead of OleDB ones. In this case the connection string is:

"FIL=MS Access;DSN=AIS_Local"

and the error is:

"ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Disk or
network error.\r\nERROR [IM006] [Microsoft][ODBC Driver Manager]
Driver's SQLSetConnectAttr failed\r\nERROR [HY000] [Microsoft][ODBC
Microsoft Access Driver] Disk or network error."

Need HELP!!!
tks



Hal Levy May 26th, 2004 09:28 AM

Roberto,

I suggest you post your question- in detail- and see if someone can help you.

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee

asomani November 4th, 2004 04:48 PM

Quote:

quote:Originally posted by r.cicca
 I had the same exactly problem and today I didn't find a solution.
Did you had find a solution?
Thanks,
Abhishek

Quote:

quote:Originally posted by gdelia1
 Hi there,

I got a problem using an MS Access database through ASP.NET.

After updating my system from .NET Framework 1.0 to 1.1, my existing
application gives me the following error when opening a connection
with the code below:

"Unspecified error" (ErrorCode: -2147467259)

string connectionStringKey = "LocalDBConnectionString";
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\InetPub\wwwroot\IS_Italy_2003\IS.mdb";

OdbcConnection connection = new OdbcConnection(connectionString);
try
{
connection.Open();
}
catch (OdbcException ex)
{
string error = ex.Message;
}
finally
{
connection.Close();
}

What's really strange is that:
1. The same application works on some of my colleagues' computers with
the .net Framework 1.1
2. The very same code works on my computer when creating a brand new
application with VS.NET 2003
3. The same application was working with .NET Framework 1.0

The same thing happens (including the two cases above) when using ODBC
classes instead of OleDB ones. In this case the connection string is:

"FIL=MS Access;DSN=AIS_Local"

and the error is:

"ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Disk or
network error.\r\nERROR [IM006] [Microsoft][ODBC Driver Manager]
Driver's SQLSetConnectAttr failed\r\nERROR [HY000] [Microsoft][ODBC
Microsoft Access Driver] Disk or network error."

Need HELP!!!
tks




sitthichai October 5th, 2005 01:50 AM

I have been trying to find this error for couple hours and finally I figured it out!

--->> check your form you may have 2 duplicate input

~Den


All times are GMT -4. The time now is 07:43 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.