Silly ODBC Connection problem

D

DingoBoy

I have an Oracle database running on Windows Server 2003, for which I have
created a System DSN named "MyDSN" in the ODBC Administrator tool. I can test
the connection without problems in the ODBC Administrator, however when I use

conn = gcnew OdbcConnection("DSN=MyDSN;UID=User;PWD=Pass");

It gives me the error
"ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found
and no default driver specified"

I am at a loss, the DSN is defined as a System DSN which can be succesfully
tested with the same user and password, yet through the above code I cannot
get a connection.

Any thoughts would be hugely appreciated

Cheers

Justin
 
W

William Vaughn

I would suspect that the DSN is not properly registered. This is a typical
error for ODBC. It's one (of the many) reasons ADO OLE DB and ADO.NET
providers were created to bypass these generic OSFA interfaces in favor or
native interfaces.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
 
D

DingoBoy

Thanks for the reply William,

I am thinking I will probably pursue the ADO.NET provider option instead of
wasting
my time on this ODBC issue. Just out of interest, would you happen to know
what
may be required to properly register the DSN?

Cheers

Justin

William Vaughn said:
I would suspect that the DSN is not properly registered. This is a typical
error for ODBC. It's one (of the many) reasons ADO OLE DB and ADO.NET
providers were created to bypass these generic OSFA interfaces in favor or
native interfaces.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
DingoBoy said:
I have an Oracle database running on Windows Server 2003, for which I have
created a System DSN named "MyDSN" in the ODBC Administrator tool. I can
test
the connection without problems in the ODBC Administrator, however when I
use

conn = gcnew OdbcConnection("DSN=MyDSN;UID=User;PWD=Pass");

It gives me the error
"ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found
and no default driver specified"

I am at a loss, the DSN is defined as a System DSN which can be
succesfully
tested with the same user and password, yet through the above code I
cannot
get a connection.

Any thoughts would be hugely appreciated

Cheers

Justin
 
W

William Vaughn

Ah, it seems to me this must be done interactively on each client--either
that or use the magical "DSN-less" connection. It's been 11 or years or so
since I wrote about ODBC ('97) so it's getting kinda fuzzy. The problem is
each time the driver revs, the interface to create the DSNs programmatically
change as well. The easiest course is hand-register or just move into the
21st century... ;)

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
DingoBoy said:
Thanks for the reply William,

I am thinking I will probably pursue the ADO.NET provider option instead
of
wasting
my time on this ODBC issue. Just out of interest, would you happen to know
what
may be required to properly register the DSN?

Cheers

Justin

William Vaughn said:
I would suspect that the DSN is not properly registered. This is a
typical
error for ODBC. It's one (of the many) reasons ADO OLE DB and ADO.NET
providers were created to bypass these generic OSFA interfaces in favor
or
native interfaces.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
DingoBoy said:
I have an Oracle database running on Windows Server 2003, for which I
have
created a System DSN named "MyDSN" in the ODBC Administrator tool. I
can
test
the connection without problems in the ODBC Administrator, however when
I
use

conn = gcnew OdbcConnection("DSN=MyDSN;UID=User;PWD=Pass");

It gives me the error
"ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not
found
and no default driver specified"

I am at a loss, the DSN is defined as a System DSN which can be
succesfully
tested with the same user and password, yet through the above code I
cannot
get a connection.

Any thoughts would be hugely appreciated

Cheers

Justin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top