链接数据库的问题
Microsoft OLE DB Provider for SQL Server (0x80004005)
用户 'sa ' 登录失败。原因: 未与信任 SQL Server 连接相关联。
/db/conn.asp, 第 5 行
???
conn.asp如以下代码
<%
set conn=server.CreateObject( "ADODB.Connection ")
'sql= "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_03 "
'conn.open(sql)
conn.open( "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_03 ")
set rs=server.CreateObject( "ADODB.RecordSet ")
rs.Cursortype=adOpenStatic
%>
------解决方案-------------------- <%
set conn=server.CreateObject( "ADODB.Connection ")
conn.open( "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_03 ")
set rs=server.CreateObject( "ADODB.RecordSet ")
rs.ActiveConnection=conn
rs.Cursortype=adOpenStatic
%>