2
完整的错误:ASP连接MySQL错误80004005 “无法连接到MySQL服务器 'IP'”
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP' (10065)
/test.asp, line 17
试图连接到使用ASP MySQL数据库。获得上述错误,我不知道为什么。显然,错误编号意味着数据不可访问,但并不是说为什么。
任何人都有这方面的经验?
<%
Dim oConn, oRs
Dim qry, connectstr
Dim db_name, db_username, db_userpassword
Dim db_server
db_server = "IP"
db_name = "DBNAME"
db_username = "USERNAME"
db_userpassword = "PASS"
fieldname = "FIELDNAME"
tablename = "TABLENAME"
connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr
qry = "SELECT * FROM " & tablename
Set oRS = oConn.Execute(qry)
if not oRS.EOF then
while not oRS.EOF
response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & "<br>"
oRS.movenext
wend
oRS.close
end if
Set oRs = nothing
Set oConn = nothing
%>
由于显而易见的原因删除了值。
错误信息很清楚。该IP必须是不正确的或与网络连接相关的其他内容会影响您的连接 – Rafael
也可能是权限。试试看这里http://tutorials.aspfaq.com/8000xxxxx-errors/80004005-errors.html – 2012-12-12 20:00:41
“IP”必须是您的网络上的服务器名称。如果不是,那么这个错误就是它所说的。 –