Tuesday, March 20, 2012

OleDB open connection fails for user DSN

Platform: VC 7.0, Windows 2000
Database: SQL Server 2000
Hi,
I created an API, in-proc server, which uses OLEDB to open connection for a
given DSN.
When I create system dsn and execute API from SQL Server Store procedure it
success.
When I create user dsn and execute API from SQL Server Store procedure it
fails and returns error "Data source name not fond and no default driver
specified".
May I know reason for failing API for user DSN? Is there any solution.
Thanks in advance.
Regards
VijayA user DSN is specific to the user logged in... For this to work you must
create a user DSN for the same user that SQL is using ( since you are doing
this in a sp)... Most people would create a System DSN and not even worry
about it though.
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"vijay" <vijaysingh@.abo.abosoftware.com> wrote in message
news:u9puL320DHA.4064@.tk2msftngp13.phx.gbl...
> Platform: VC 7.0, Windows 2000
> Database: SQL Server 2000
>
> Hi,
> I created an API, in-proc server, which uses OLEDB to open connection for
a
> given DSN.
>
> When I create system dsn and execute API from SQL Server Store procedure
it
> success.
>
> When I create user dsn and execute API from SQL Server Store procedure it
> fails and returns error "Data source name not fond and no default driver
> specified".
>
> May I know reason for failing API for user DSN? Is there any solution.
>
> Thanks in advance.
>
> Regards
> Vijay
>
>|||How could I decide which DSN should be crated i.e. either system dsn or user
dsn.
Vijay
Sr. Software Engineer
ABO Software
New Delhi
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:eS7jFH40DHA.2396@.TK2MSFTNGP09.phx.gbl...
> A user DSN is specific to the user logged in... For this to work you must
> create a user DSN for the same user that SQL is using ( since you are
doing
> this in a sp)... Most people would create a System DSN and not even worry
> about it though.
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Computer Education Services Corporation (CESC), Charlotte, NC
> www.computeredservices.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
>
> "vijay" <vijaysingh@.abo.abosoftware.com> wrote in message
> news:u9puL320DHA.4064@.tk2msftngp13.phx.gbl...
> > Platform: VC 7.0, Windows 2000
> >
> > Database: SQL Server 2000
> >
> >
> >
> > Hi,
> >
> > I created an API, in-proc server, which uses OLEDB to open connection
for
> a
> > given DSN.
> >
> >
> >
> > When I create system dsn and execute API from SQL Server Store procedure
> it
> > success.
> >
> >
> >
> > When I create user dsn and execute API from SQL Server Store procedure
it
> > fails and returns error "Data source name not fond and no default driver
> > specified".
> >
> >
> >
> > May I know reason for failing API for user DSN? Is there any solution.
> >
> >
> >
> > Thanks in advance.
> >
> >
> >
> > Regards
> >
> > Vijay
> >
> >
> >
> >
>

No comments:

Post a Comment