奇怪问题!connection可以创建,但是不能打开!
程序如下,各位高手帮忙看看!
<% @Language = "VBScript" %>
<%
dim conn
set conn=server.createobject("ADODB.CONNECTION")
if err.number<>0 then
err.clear
set conn=nothing
Response.Write "创建ADO对象失败"
Response.End
else
conn.open "webdb","sa",""
if err.number<>0 then
err.clear
set conn=nothing
Response.Write "SQL数据库连接失败,请检查数据库是否存在,以及odbc是否存在"
Response.End
end if
end if
set rs=conn.execute("select count(*) as a1 from addr")
%>
<%=rs("a1")%>
<%rs.close
conn.close
set rs=nothing
set conn=nothing
%>
执行到conn.open "webdb","sa",""时出错,
错误类型:
ADODB.Connection (0x800A0E7A)
/test.asp, 第 11 行