当前位置:编程学习 > VB >>

急急急急急急急!!!!!实时错误'-2147168242(8004d00e)'

Public Function ExecSql(ByVal sql As String) As Boolean                   '执行 Sql 语句,返回成功或失败
Debug.Print sql
On Error GoTo err:
    cmd.ActiveConnection = getCon
    cmd.CommandText = sql
    cmd.CommandTimeout = 30
    cmd.CommandType = adCmdText
    cmd.Execute
    ExecSql = True
    Exit Function
err:
    conn.RollbackTrans
    MsgBox err.Description
    ExecSql = False
End Function


麻烦帮忙看一下 --------------------编程问答-------------------- 你的 sqlstr 是传入什么值啊?

cmd. 是什么?ado控件?? --------------------编程问答-------------------- 如果conn没有成功BeginTrans的话
conn.RollbackTrans 是会产生错误的
补充:VB ,  基础类
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,