Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does VFPcomm.RSToCursor not work with numeric fields?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Why does VFPcomm.RSToCursor not work with numeric fields?
Divers
Thread ID:
00463915
Message ID:
00463915
Vues:
46
Run the following snippet from a prg. You will find that the RecordSet that has members that are numeric are not converted to a cursor using VFPcomm.RSToCursor. Is the source code for RSToCursor available anywhere. (I found the source for DBFtoRS.PRG from somewhere.)
public o
o = createobject('oTest')

o.makeRSnumeric()
ovcomutil.RSToCursor(o.oRS)		&& No cursor created

o.makeRSchar()			
ovcomutil.RSToCursor(o.oRS)		&& Cursor created
brow norm

 
DEFINE CLASS oTest AS custom &&OLEPUBLIC
	oRS = NULL
	FUNCTION makeRSchar
		create cursor cTest (FieldOne c(10))
		insert into cTest (fieldone) values ('1')
		insert into cTest (fieldone) values ('2')
		insert into cTest (fieldone) values ('3')
		this.oRS = CreateObject("ADODB.Recordset")

		oComUtilClass = create("vfpcom.comutil")
		oComUtilClass.CursorToRS(this.oRS)
		use in cTest
		RETURN
	ENDFUNC

	FUNCTION makeRSnumeric
		create cursor cTest (FieldOne n(10,0))
		insert into cTest (fieldone) values (1)
		insert into cTest (fieldone) values (2)
		insert into cTest (fieldone) values (3)
		this.oRS = CreateObject("ADODB.Recordset")

		oComUtilClass = create("vfpcom.comutil")
		oComUtilClass.CursorToRS(this.oRS)
		use in cTest
		RETURN
	ENDFUNC

ENDDEFINE
Répondre
Fil
Voir

Click here to load this message in the networking platform