Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating an ADO recordset from a VFP cursor
Message
De
14/02/2001 09:11:06
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Creating an ADO recordset from a VFP cursor
Divers
Thread ID:
00475667
Message ID:
00475667
Vues:
67
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
Fil
Voir

Click here to load this message in the networking platform