|
Dim Rs,Sq
Set Conn = CreateObject("Adodb.Connection")
Set Rs = CreateObject("Adodb.RecordSet")
Conn.ConnectionString="rovider=MSDAORA.1;User ID=irpt411assword=irpt411;Data Source=MYORCLersist Security Info=False"
Conn.Open
If Conn.State = 0 Then
Reporter.ReportEvent micFail, "测试连接","数据库连接失败!"
Conn.Close
Set Conn = Nothing
Else
Reporter.ReportEvent micPass, "测试连接","数据库连接成功!"
Set Rs = CreateObject("Adodb.RecordSet")
strSql = "Select index_,userid from irpt411.IRPT_USERS"
Rs.Open strSql,Conn
Rs.MoveFirst
Do
Rs.MoveNext
Reporter.ReportEvent micPass,"数据为:", cstr(Rs(0)) & cstr(Rs(1))
Reporter.ReportEvent micPass,"数据为:", Rs.Fields(0)+Rs.Fields(1)
Loop Until Rs.EOF= True
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
End If
为什么红色标记的两种方法都得不到结果?运行提示General run error. |
|