ASP vs ASP.NET connecting to SQL Server

A

Andy Sutorius

When I run a ASP.NET application (ASP.NET Report Starter Kit) against SQL
Server I receive "User cannot login with null"

However when I run an ASP application against the same SQL Server it
works flawlessly

What setting am I missing in ASP.NET?

I have 2 computers, one is the web server the other is the sql server. I
am using SQL Authentication (not Windows Auth.)

For the ASP.NET application I have the connection string in the
web.config file with the user id and pwd in the conn string and trusted
connection set to true

In my ASP I have the following:
<html>
<head>
<title>HTMLPage1</title>
</head>
<body>
<%
cst = "Provider=SQLOLEDB;Data Source=SUTORIUSI;" & _
"Initial Catalog=Pubs;Network=DBMSSOCN;" & _
"User Id=sa;Password=sterling"
set conn = CreateObject("ADODB.Connection")
conn.open cst
set rs = conn.execute("Select au_lname from authors" )
do while not rs.eof
response.Write(rs(0) & "<br>")
rs.movenext
loop
%>
</body>
</html>
 
C

Chris Jackson

If you have set it up to use a trusted connection, then it will be using
Windows Authentication. Try removing this clause and using the same
connection string.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Reinstalled SQL-server 5
Build a table with ASP.net 2
asp help 1
How to change default sql server? 4
asp to asp.net 2
QueryString asp to asp.net 1
Asp.Net and XML 3
how do to do this in asp.net? 2

Top