mdlopenrecord.bas

来自「VB6.0编写的医院影像系统」· BAS 代码 · 共 42 行

BAS
42
字号
Attribute VB_Name = "mdlOpenRecord"
Option Explicit

Public Function OpenRSClient(ByVal sSQL As String) As ADODB.Recordset
On Error GoTo ErrHandle
    
'-----------------------
'返回sSQL所指定的记录集
'-----------------------
    
Dim tempRS As New ADODB.Recordset
    
    tempRS.CursorLocation = adUseClient
    tempRS.Open sSQL, GDB, adOpenKeyset, adLockOptimistic
    
    Set OpenRSClient = tempRS
    Exit Function
    
ErrHandle:

End Function

Public Function OpenRSBatch(ByVal sSQL As String) As ADODB.Recordset
On Error GoTo ErrHandle

'-----------------------
'返回sSQL所指定的记录集
'-----------------------

Dim tempRS As New ADODB.Recordset
    
    tempRS.CursorLocation = adUseClient
    tempRS.Open sSQL, GDB, adOpenStatic, adLockBatchOptimistic
        
    Set OpenRSBatch = tempRS
    Exit Function
    
ErrHandle:

End Function

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?