Public Function GetRecordset(ByVal strUser As String, ByVal strSql As String, Optional ByVal strCon As String) As ADODB.Recordset
Dim objAdoRs As ADODB.Recordset
Dim sngTmr As Single
Dim strMsg As String On Error Resume Next Dim objContext As ObjectContext
Set objContext = GetObjectContext() On Error GoTo Errhandler sngTmr = Timer Set objAdoRs = New ADODB.Recordset With objAdoRs
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockReadOnly
.Open strSql, IIf(UCase$(strCon) = "abc", CONN_abc, IIf(UCase$(strCon) = "a", CONN_a, CONN_A))
Set .ActiveConnection = Nothing
End With Set GetRecordset = objAdoRs LogTransaction strUser, IIf(UCase$(strCon) = "abc", CONN_abc, IIf(UCase$(strCon) = "C", CONN_C, CONN_A)), strSql, "clsAmasDb.GetRecordset" If Not objContext Is Nothing Then
objContext.SetComplete
End If Exit Function Errhandler: If Not objContext Is Nothing Then
objContext.SetAbort
End If
'Err.Raise Err.Number, Err.Source, Err.Description
LogError Err.Description, strUser, IIf(UCase$(strCon) = "abc", CONN_S, IIf(UCase$(strCon) = "E", CONN_EQC, CONN_A)), strSql, "clsAmasDb.GetRecordset" End Function这个无何加入timeout? 谢谢先
Dim objAdoRs As ADODB.Recordset
Dim sngTmr As Single
Dim strMsg As String On Error Resume Next Dim objContext As ObjectContext
Set objContext = GetObjectContext() On Error GoTo Errhandler sngTmr = Timer Set objAdoRs = New ADODB.Recordset With objAdoRs
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockReadOnly
.Open strSql, IIf(UCase$(strCon) = "abc", CONN_abc, IIf(UCase$(strCon) = "a", CONN_a, CONN_A))
Set .ActiveConnection = Nothing
End With Set GetRecordset = objAdoRs LogTransaction strUser, IIf(UCase$(strCon) = "abc", CONN_abc, IIf(UCase$(strCon) = "C", CONN_C, CONN_A)), strSql, "clsAmasDb.GetRecordset" If Not objContext Is Nothing Then
objContext.SetComplete
End If Exit Function Errhandler: If Not objContext Is Nothing Then
objContext.SetAbort
End If
'Err.Raise Err.Number, Err.Source, Err.Description
LogError Err.Description, strUser, IIf(UCase$(strCon) = "abc", CONN_S, IIf(UCase$(strCon) = "E", CONN_EQC, CONN_A)), strSql, "clsAmasDb.GetRecordset" End Function这个无何加入timeout? 谢谢先
你可以把所有模块放到脚本中来使用。
谢谢你先
不是有*.timeout = X 的设置么?
格式如下:setTimeout("Function",Time)Function为你要执行的函数,
Time 为执行的时间间隔,单位为毫秒.