Discussion Locked

MS ODBC/OLEDB --> ASP & SQL SERVER he

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am a novice here, so need some clarification on what I have. I built an ASP page using the following connection string:
strConnectString = "Driver={SQL Server}; Server="&gServer&";;"
Basically, depending on the server on my network, it will login in using TRUSTED CONNECTION, on any SQL Server. I have verified that I can connect to each of the "problem" servers via trusted connection. THIS ALL WORKED BEFORE, and then had some problems with SQL 2000 sp1.
Anyway, regarding my SQL v6.5 servers, when I click on link to login in I get this:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server] Login failed
Now, the strange part is that some 6.5 servers doconnect and get the info, others fail out. I am not sure, but is my DNS-less connection using ODBC, OLEDB, and what SQL Server driver??? (SQLSRV32.dll?)
I need DNS-less, so I don't have to create DSN for each server. The SQL Server driver I amusing now is: v.3.70.06.90 (4/5/99)..Funny thing is that all driver versions worked before, if in fact this is the driver it is using......HELP!!! THanks much!

3 replies

by andrew

It appears that you're using ODBC.

I would use a connection string similar to the following:

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=[DB_Name];Data Source=[ServerName]

This will use pure OLEDB.

Personally, I prefer to use SQL authentication, even over trusted connections. This allows me to have tighter control on the security, and works on machines where no one is logged in.

One other thing to keep in mind: you should use the TCP/IP network library (dbmssocn)to connect to remote SQL servers, not Named Pipes (dbnmpntw).

If you don't have the Client network utility, you can run the following registry script to set this up:

REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Client\ConnectTo]
"DSQUERY" = "DBMSSOCN"

This discussion is closed to new replies.