General information
Category:
COM/DCOM and OLE Automation
Title:
Creating an ADO recordset from a VFP cursor
I have read a thread on the 12th of january about this, but it didn't really give the answer I was looking for.
I have the following method in a multi-threaded COM object:
LParameters oRecordSet
Local lnTeller
lnTeller = 0
#DEFINE C_VFPCOMCLASS 'vfpcom.comutil'
oADO = CreateObject(C_VFPCOMCLASS)
nError = oADO.RSToCursor(oRecordSet, 'mycursor')
IF nError > 0
RETURN .F.
ENDIF
SELECT mycursor
GO TOP
SCAN ALL
lnTeller = lnTeller + 1
REPLACE mycursor.volgnr WITH PADL(ALLTRIM(STR(lnTeller)),5,'0')
ENDSCAN
oResultSet=CreateObject('ADODB.RECORDSET')
nError = oADO.CursorToRS(oRecordSet)
IF nError < 0
RETURN nError
ENDIF
RETURN oResultSet
With or without the line "oResultSet=CreateObject('ADODB.RECORDSET')" it gives me a returnvalue '-8', indicating the recordset already exists. Is there a way around this?
Johan
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only