Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does VFPcomm.RSToCursor not work with numeric fields?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Why does VFPcomm.RSToCursor not work with numeric fields?
Miscellaneous
Thread ID:
00463915
Message ID:
00463915
Views:
45
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
Reply
Map
View

Click here to load this message in the networking platform