conn.asp
<%
dim conn, connstr
connstr="Driver={SQL SERVER};server=(local);uid=sa;pwd=sql-newsunserver;database=lis40;"
set conn=server.createobject("adodb.connection")
%>
diaoyong.asp
<!--#include file="conn.asp" -->
<%
conn.open connstr
sql="select * from bt_ybfzxx"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<%do while not rs.eof%>
<%=rs("yqdh")%>
<%=rs("cdrq")%>
<%=rs("ybbh")%>
<%=rs("xmdh")%>
<%=rs("xmcdz")%>
<%
rs.movenext
loop
%>
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]用户 'sa' 登录失败。
/test1/diaoyong.asp, 第 3 行