[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

File Not Found Error with OdbcConnection

Teodorico Morell

3/5/2002 2:01:00 AM

I'm getting the following error:
"An unhandled exception of type 'System.IO.FileNotFoundException' occurred
in ADO01.exe"

I'm importing:
using System.Data;

using Microsoft.Data.Odbc;

The code:

string strCon = "dsn=oracle;UID=bsc;PWD=bsc;";

OdbcConnection con = new OdbcConnection(strCon); // Error.

Any idea?



Thanks.





3 Answers

(Steven Bras [MS])

3/5/2002 10:48:00 PM

0

Teodorico Morell

3/6/2002 3:16:00 PM

0

If I call the function as:
.
.
ODBC();
.
.
private void ODBC()
{
try
{
string strCon = "dsn=oracle;UID=bsc;PWD=bsc;";
OdbcConnection con = new OdbcConnection(strCon); // Error.
} catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}


I get: "An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in ADO01.exe" at
the call "ODBC();". The function is never entered.


If I place the code inline I get: "An unhandled exception of type
'System.IO.FileNotFoundException' occurred in system.windows.forms.dll"
at:

static void Main()
{
Application.Run(new Form1());
} <--- ERROR


I can use System.Data.OleDb with Oracle and Data.SqlClient with MS SQL
Server.
But the error generates when accessing Microsoft.Data.Odbc. I am using the
same connect string.


Thanks.



babu

3/8/2002 1:19:00 AM

0

I am getting the same error with vb.net. I am using Sybase
SQL Anywhere, so I do not have the luxury of using OLEDB
Data Proivider.

Is it because the ODBC.NET did not get installed properly
or do we require MDAC2.6 instead of MDAC2.7RTM?

Any answers?

>-----Original Message-----
>If I call the function as:
>..
>..
> ODBC();
>..
>..
>private void ODBC()
>{
> try
> {
> string strCon = "dsn=oracle;UID=bsc;PWD=bsc;";
> OdbcConnection con = new OdbcConnection
(strCon); // Error.
> } catch (Exception ex)
> {
> MessageBox.Show(ex.Message);
> }
>}
>
>
>I get: "An unhandled exception of
type 'System.IO.FileNotFoundException'
>occurred in ADO01.exe" at
>the call "ODBC();". The function is never entered.
>
>
>If I place the code inline I get: "An unhandled exception
of type
>'System.IO.FileNotFoundException' occurred in
system.windows.forms.dll"
>at:
>
> static void Main()
> {
> Application.Run(new Form1());
> } <--- ERROR
>
>
>I can use System.Data.OleDb with Oracle and
Data.SqlClient with MS SQL
>Server.
>But the error generates when accessing
Microsoft.Data.Odbc. I am using the
>same connect string.
>
>
>Thanks.
>
>
>
>.
>