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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Connecting to Sql2000 using asp 1

Status
Not open for further replies.

minckle

Programmer
Mar 17, 2004
142
0
0
GB
Hi im trying to connect an asp page to SQL Server(localhost), but i keep getting errors, and im a little bit stuck where to go from here. Not sure what details help decie whats wrong so i've pasted the code and error below. I can tell you that i can connect ok with a .Net application using the same connection string/username. there is no password. SQLServer Authentication is set to "SQL Server and Windows" and the username is in the Users list on the DB.

Code:
<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Q2A;User Id=Matt Inckle;Password=;"
%>

Error:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'Matt Inckle'.
/what1/test.asp, line 4

Thanks for your time !!!
 
try putting
Trusted_Connection=yes
in your string

something like this:

conn.Open "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Q2A;User Id=Matt Inckle;Password=;Trusted_Connection=yes;"

of course everything should be on a single line...

-DNG
 
No luck im afraid. as soon as i use 'Trusted_Connection=yes;' its trying to use 'IUSR_MATT-LAPPY' for the username, but thats not the 1 i put in the code.

Error:
Login failed for user 'MATT-LAPPY\IUSR_MATT-LAPPY'.
 
If DNG's link did not do it I may have a quick and dirty tip... Use the username sa (system administrator) and use the password that you input during install of SQL Server. I am assuming you are using localhost for just developing apps offline, this would not do for a live site.

[sub]&quot;Nothing is impossible until proven otherwise&quot;[/sub]​
 
madanthrax said:
Use the username sa (system administrator) and use the password that you input during install of SQL Server

Good tip for trouble shooting but to add to that never leave the sa account as the login credentials in any interface you are developing.

I could be wrong but I do not believe you can have a space in the name. try removing it.

 
I knew I would get my wrist slapped for that.......

[sub]&quot;Nothing is impossible until proven otherwise&quot;[/sub]​
 
Hey, its better than the old days when the default password for sa was blank!
 
don't get me going on that subject. you have no idea how many times I still see that consulting *sigh*

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top