日期:2014-05-17  浏览次数:21129 次

关于用ODBC联sql2000的问题
我采用ODBODBC联sql2000,如下   :
<%    
Set   dbCon   =   Server.CreateObject( "ADODB.Connection ")
dbCon.Open   "jing3 ", " ", " "
set   dbRS=dbCon.Execute( "   SELECT   *   FROM   qtxl   order   by   area,dep   ")    
%>    
出错提示如下:
[Microsoft][ODBC   SQL   Server   Driver][SQL   Server]Login   failed   for   user   'AAA123\IUSR_AAA123 '.  

AAA123是计算机名。

------解决方案--------------------
给你个例子吧:

<% '建立连接
dim conn
Set conn=Server.CreateObject( "ADODB.Connection ")
conn.ConnectionTimeout=20
conn.open "driver={SQL Server};server=localhost;uid=sa;pwd=sa;database=ExamRun "
Sub CloseDb()
If Conn.State = 1 Then
Conn.Close
End If
Set Conn = Nothing
End Sub
%>