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

Re: Silly ODBC Connection problem by William

William
Wed Mar 05 17:57:22 CST 2008

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" <DingoBoy@discussions.microsoft.com> wrote in message
news:CB0414A2-D9B0-4C8C-B518-63DA466BAF7A@microsoft.com...
>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


Re: Silly ODBC Connection problem by DingoBoy

DingoBoy
Wed Mar 05 19:35:03 CST 2008

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" wrote:

> 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" <DingoBoy@discussions.microsoft.com> wrote in message
> news:CB0414A2-D9B0-4C8C-B518-63DA466BAF7A@microsoft.com...
> >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
>

Re: Silly ODBC Connection problem by William

William
Thu Mar 06 18:42:20 CST 2008

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" <DingoBoy@discussions.microsoft.com> wrote in message
news:223B0447-28A9-4F50-A5AA-2C4C5BD50A60@microsoft.com...
> 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" wrote:
>
>> 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" <DingoBoy@discussions.microsoft.com> wrote in message
>> news:CB0414A2-D9B0-4C8C-B518-63DA466BAF7A@microsoft.com...
>> >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
>>