ASP connection MSSQL error: Access Denied in an ASP program cannot connect to MSSQL normally. the error message is as follows:
HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Sun, 11 Jun 2006 00:59:27 GMT Connection: close Content-Length: 65 Content-Type: text/html Cache-control: private
HTTP/1.1 401 error: Access Denied.
Program Source File:
<%
Dim SqlLocalName, SqlUsername, SqlPassword, SqlDatabaseName, Conn, ConnStr, db, Err_OpenDatabase
SqlLocalName = "(local)" 'connection IP address [local IP address used outside China]
SqlUsername = "sa" 'user name
SqlPassword = "zhengque" 'user password
SqlDatabaseName = "vnut" 'database name
Set conn = Server. CreateObject ("ADODB. Connection ")
Connstr = "Provider = Sqloledb; User ID =" & SqlUsername & "; Password =" & SqlPassword & "; Initial Catalog =" & SqlDatabaseName &"; data Source = "& SqlLocalName &";"
Conn. Open connstr
Sub CloseConn ()
On Error Resume Next
Conn. close
Set Conn = nothing
End sub
%>
The reason is:
Or
Your sa password is incorrect.
Otherwise, your mysql instance is not started.