[求助]请问这是什么问题,为什么总报错
Function DataToRsStatic(Conn,strSql)Dim RsStatic
On Error Resume Next
Set DataToRsStatic = Nothing
If Conn Is Nothing Then
Exit Function
End If
Set RsStatic = CreateObject("ADODB.RecordSet")
RsStatic.CursorLocation = 3
RsStatic.Open strSql,Conn,3,3
If Err.Number <> 0 Then
Exit Function
End If
Set DataToRsStatic = RsStatic
End Function
Sub Dwclient1_CallerIDComing(CallerID,ConnectStr)
m_InCallRef = 1
m_CallerID = ""
m_InboundCallTime = Now()
m_CallerID = CallerID
DialNumber.value = m_CallerID
m_CallLogID = InsertCallLog(time(), m_CallerID, "")
ExtStatus.innerHTML = CallerID + "来电"
Dim conn
dim rstData
Set Conn = CreateObject("ADODB.Connection")
conn.open "DRIVER={SQL Server};SERVER=192.168.0.100;DATABASE=aaa;UID=sa;PWD=aaa"
strSql = "SELECT * FROM DW_CUSTOMER where CUS_MOBILE = '" & CallerID & "' or CUS_PHONE = '" & CallerID & "'"
rstData = DataToRsStatic(conn, strSql)
If (rstData.EOF) Then
nam.innerHTML=rstData("CUS_UNIT")
End if
rstData.Close
Set rstData = nothing
conn.close
Set conn=Nothing
执行以后老是有错误说:对象不支持此属性或方法:'rstData.EOF'
请问要怎么改,谢谢帮忙一下