Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP SQL Server Logon Problem. 1

Status
Not open for further replies.

ctau

IS-IT--Management
Feb 8, 2000
34
US
I am getting an error message when I try to connect my asp to SQL Server. I am connecting to the same database fine with visaul basic but I get the following error when I try to do it from an ASP.


[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '\'.



I am using the following code.

Set MyConnection = Server.CreateObject("ADODB.Connection")
MyConnection.Open "filedsn=c:\CDS.dsn;UID=asp;PWD=asp;"


Any suggestions would greatly appreciated.

CTAU



 
I'm pretty sure ASP won't use a file dsn properly. Try using a system dsn instead. Since ASP has to run through a server (even a PWS, or proxy server), you're using a blank user name to log into that server from a browser (unless the BROWSER asks you for a user name). I don't think you can use file dsn's with ASP without browser login. Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
I still seem to be having a problem. I have gotten a file dsn to work with Sybase but not with SQL Server. I changed my script to use a system named CDS. It works fine in both Access and VB but not in my ASP. I tried the statement below but received the same error message as above. I have also tried to explicitly put the password and I get the same message.

set Myconnection = Server.CreateObject("ADODB.Connection")
MyConnection.Open "CDS"
 
I am sorry, but I'm not sure at all what is wrong. ASP should connect fine using a DSN connnection. Maybe you should try using a DSN-less connection to your database (remember to add the user name and password to your connection string). The DSN should work fine though.

Sorry. Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top