[lnkForumImage]
TotalShareware - Download Free Software

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


 

Jeff

6/19/2002 7:45:00 PM

I am trying to connect to a System DSN using the ODBC .NET
provider. When I set the connection string to "DSN=xxx";
I get a data source not found error.

I do not want to use a Driver= keyword, but when I do use
one like "Driver={SQL Server};DSN=Info;" I get a SQL
Driver error that DSN was not specified.

Is there some problem with the DSN keyword?

Thanks,
Jeff
1 Answer

(Steven Bras [MS])

6/19/2002 10:13:00 PM

0

If you are using the driver keyword, you need not specify (nor should you
specify) a DSN as well. All the information can be contained in the
connection string such as server, database, user id and password if
applicable.

However, you don't specify whether you're using the ODBC.Net provider in
ASP.Net or a Windows application; in either case (more commonly with
ASP.Net) this error is due to the fact that the DSN definition in the
registry cannot be accessed, due to restricted permissions on that hive.

I would start there and check the permissions on the following two keys
(depending on whether your DSN is a user DSN or a system one):

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC and its subkeys
and
HKEY_CURRENT_USER\Software\ODBC and its subkeys

Make sure they allow Read access, at minimum to the following groups:

HKLM: Admins, Creator Owner, Power Users, System, and Users
HKCU: Administrators, Restricted, and System

Hope this helps!

Steven Bras, MCSD
Microsoft Developer Support/Visual Basic WebData

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.co....