Exit Function
Conerr:
Set GETCN = Nothing
MsgBox "Database connection error", vbcritical
End Function
' Execute a SQL statement, correctly return 1
Public Function Excutesql (sSQL as String) as Integer
Dim m_cn as New ADODB. Connection
On Error GoTo Err
Set m_cn = GETCN (Sg_dbpath)
M_cn. Execute sSQL
M_cn. Close
Set m_cn = Nothing
Excutesql = 1
Exit Function
Err:
Excutesql = 0
Set m_cn = Nothing
End Function
' Execute a set of SQL statements that correctly returns 1
Public Function Excutesqlex (sSQL () as String) as Integer
' Invoke transaction processing
Dim m_cn as New ADODB. Connection, I as Integer
If UBound (sSQL) < 0 Then Exit Function
On Error GoTo Err
Set m_cn = GETCN (Sg_dbpath)
M_cn. BeginTrans
For i = 0 to UBound (sSQL)-1
M_cn. Execute sSQL (i)
Next I
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.