Hi All
I am having a problem with the following code in that when it is run an error is thrown from OLEAUT32.dll.
Can anyone explain the problem please.
RSFind proc Criteria:ptr BYTE
local bstrCriteria:BSTR
local wszBuff:DWORD
local State: SDWORD
local RecordCount:DWORD
invoke vf( pRS, _Recordset, get_State), addr State
mov eax, State
.if (eax == adStateOpen)
invoke RSFirst
invoke MultiByteToWideChar, CP_ACP, 0, Criteria, -1, wszBuff, MAXPATH
invoke SysAllocString, wszBuff
mov bstrCriteria, eax
invoke vf(pRS, _Recordset, Find), bstrCriteria, 0, adSearchForward, vtMissing
invoke vf(pRS, _Recordset, get_RecordCount),addr RecordCount
invoke SysFreeString, bstrCriteria
PrintDec RecordCount
.endif
ret
RSFind endp
Thanks in advance
Liamo
I am having a problem with the following code in that when it is run an error is thrown from OLEAUT32.dll.
Can anyone explain the problem please.
RSFind proc Criteria:ptr BYTE
local bstrCriteria:BSTR
local wszBuff:DWORD
local State: SDWORD
local RecordCount:DWORD
invoke vf( pRS, _Recordset, get_State), addr State
mov eax, State
.if (eax == adStateOpen)
invoke RSFirst
invoke MultiByteToWideChar, CP_ACP, 0, Criteria, -1, wszBuff, MAXPATH
invoke SysAllocString, wszBuff
mov bstrCriteria, eax
invoke vf(pRS, _Recordset, Find), bstrCriteria, 0, adSearchForward, vtMissing
invoke vf(pRS, _Recordset, get_RecordCount),addr RecordCount
invoke SysFreeString, bstrCriteria
PrintDec RecordCount
.endif
ret
RSFind endp
Thanks in advance
Liamo
Hi,
most likely you shouldnt free the bstrCriteria object.
Japheth
most likely you shouldnt free the bstrCriteria object.
Japheth