Home > Database > Mysql Tutorial > ASP连接 MSSQL的错误: 拒绝访问_MySQL

ASP连接 MSSQL的错误: 拒绝访问_MySQL

WBOY
Release: 2016-06-01 13:57:22
Original
844 people have browsed it

    在一次ASP程序中不能正常连接MSSQL出现出错信息如下:

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 错误: 拒绝访问。

程序源文件:

dim SqlLocalName,SqlUsername,SqlPassword,SqlDatabaseName,Conn,ConnStr,db,Err_OpenDatabase
SqlLocalName ="(local)" '连接IP [ 本地用 (local) 外地用IP ]
SqlUsername ="sa" '用户名
SqlPassword ="zhengque" '用户密码
SqlDatabaseName="vnut" '数据库名
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
%>

原因是:

要不就是
你的sa密码不对
要不就是你的mysql没启动

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template