7,789
社区成员
发帖
与我相关
我的任务
分享
'只要结果dB As ADODB.Connection
Public Function dbExecute(aStrsql As String) As Long
On Error GoTo ERR_INFOS
dB.Execute (aStrsql)
dbExecute = 1: Exit Function
ERR_INFOS:
dbExecute = 0
MsgBox Err.Description
End Function
'回记录集
Public Function Exerst(aStrsql As String, recordset As ADODB.recordset)
On Error GoTo ERR_INFOS
If recordset.State = 1 Then recordset.Close
strsql = aStrsql '"select * from pb_depart order by dptid"
recordset.Open strsql, dB, adOpenStatic, adLockOptimistic
Exerst = 1
Exit Function
ERR_INFOS:
Exerst = 0
MsgBox Err.Description
End Function