[DBNETLIB][ConnectionOpen (Connect()).]SQL Server 不存在或拒绝访问。
下载了一个源码
<% Response.charset="utf-8" dim conn,SqlConnectIp,SqlConnectDatabase,SqlConnectUsername,SqlConnectPassword,sqlLoginTimeout
SqlConnectIp = Request.form("dbhost") SqlConnectDatabase = Request.form("dbname") SqlConnectUsername = Request.form("dbuser") SqlConnectPassword = Request.form("dbpw") sqlLoginTimeout = 15
Set conn = Server.CreateObject("ADODB.Connection")
Connstr = "Provider =Sqloledb; User ID ="&SqlConnectUsername&"; Password ="&SqlConnectPassword&"; Initial Catalog ="&SqlConnectDatabase&"; Data Source ="&SqlConnectIp&";"
On Error Resume Next conn.Open connstr If Err.Number <> 0 Then Response.Write "数据库连接失败,请检查连接参数" Response.Write "</BR>" Response.Write ERR.Description Response.Write "</BR>" Response.Write "<input name=""submitname"" value=""返回上一步"" class=""btn"" type=""button"" onclick=""location.href='Step1.asp';"">" else Response.Write "数据库连接成功" Response.Write "</BR>" call CreatDB
End If
........
%>
我已经安装了sql2000,并修改了sa密码为123456
运行网页程序后输入下面信息
点击下一步后提示:
执行结果
数据库连接失败,请检查连接参数
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server 不存在或拒绝访问。
不知是什么原因?请教高手,谢谢!!
------解决方案--------------------查下sqlserver tcp/ip端口用的是不是1433端口