Office中国论坛/Access中国论坛

标题: [求助]access调用存储过程去错误值 [打印本页]

作者: Hai1982    时间: 2005-6-1 19:45
标题: [求助]access调用存储过程去错误值
Public Function UpdateZL(ByVal LotNo As String, ByVal lineCode As String, ByVal TypeNo As String, ByVal MachineNo As String) As Boolean

Dim QryTemp As QueryDef

On Error GoTo Err:

Set QryTemp = MyDB.QueryDefs("QryPassThrough")

QryTemp.SQL = "exec dbo.sp_Pos_info_Update '" & LotNo & "','" & lineCode & "','" & TypeNo & "','" & MachineNo & "'"

QryTemp.ReturnsRecords = False

QryTemp.connect = QryPassThrough

QryTemp.ODBCTimeout = 0

QryTemp.Execute

UpdateZL = True

Exit Function

Err:

   UpdateZL = False

   Exit Function

End Function



=================================================

这样写在access中能够取到存储过程的错误代码吗?如果存储过程失败的话。如果不能够,那我应该怎样写呢?

[此贴子已经被作者于2005-6-1 14:58:07编辑过]






欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3