|
local $connection="Driver={Microsoft ODBC for Oracle};Server="&$ipm_server&";Uid="&$ipm_uid&";Pwd="&$ipm_pwd&";"
local $adoCon = ObjCreate("ADODB.Connection" )
$adoCon.open($connection)
local $adoRS=ObjCreate("ADODB.RecordSet")
If Not @error Then
Local $sql = "select vc_stock_code,vc_stock_name,c_inquiry,c_shortlisted,c_purchase,c_win from t_ipm_ipomonitor where vc_stock_code='"&$stockCode&"'"
WriteLog($sql)
$adoRS.Open($sql,$adoCon)
Local $vc_stock_code=$adoRS.Fields("vc_stock_code").value
Local $vc_stock_name=$adoRS.fields("vc_stock_name").value
Local $c_inquiry=$adoRS.fields("c_inquiry").value
Local $c_shortlisted=$adoRS.fields("c_shortlisted").value
Local $c_purchase=$adoRS.fields("c_purchase").value
Local $c_win=$adoRS.fields("c_win").value
$adoRS.close
Else
MsgBox(0, "", "无法创建ADODB.RecordSet对象. 错误代码: " & Hex(@error, 8))
EndIf
$adoCon.close
异常:
"E:\Users\s-lib\Desktop\????\DataAccessLayer.au3" (122) : ==> The requested action with this object has failed.:
Local $vc_stock_code=$adoRS.Fields("vc_stock_code").value
Local $vc_stock_code=$adoRS.Fields("vc_stock_code")^ ERROR
原因:t_ipm_ipomonitor 没有数据记录,$adoRS.Fields("vc_stock_code").value 获取异常,大神们怎么处理这种异常!
|
|