Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement