?? modsql.bas
字號:
Attribute VB_Name = "ModSql"
Public Function ExecuteSql(ByVal strSql As String) As ADODB.Recordset
On Error GoTo ExecuteSql_Error
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset
cnn.Open "filedsn=db_lichao.dsn;uid=sa;pwd="
rst.Open Trim$(strSql), cnn, adOpenKeyset, adLockOptimistic
Set ExecuteSql = rst
ExecuteSql_Exit:
Set rst = Nothing
Set cnn = Nothing
Exit Function
ExecuteSql_Error:
Resume ExecuteSql_Exit
End Function
'處理錯誤
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -