Saturday, February 25, 2012

can anyone help?

okay i have installed sql 2000 server dev and iis6.0 and i wrote a aspscript to connect to my database through the odbc dsn that i made andwhen i run the script it says this:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
/connect.asp, line 14
and here is the code that generated this:
<%@. Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<!--StartFragment -->
<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=mssql"
If conn.errors.count = 0 Then
Response.write "Connected OK"
End If
%>
<P> </P>
</BODY>
</HTML>
could anyone help me or know what might be wrong?

You are not providing a user name. Search how to include a username for that connection. You prob just need to add the default username like 'admin' .|||well i have mysql to and when i type its dsn in it works??.....do i need to include it in the code you mean?
|||Is you username and password specified in the DSN?
Have you tried:
Conn.Open "DSN=NameofDSN;Uid=Username;Pwd=Password"

No comments:

Post a Comment