Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor adaptor - string is too long to fit .. in a memo
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00852723
Message ID:
00852811
Views:
7
--------
But that's not exactly what I want to do
The goal is to create a memo field as a sum of list fields
------------

Yes I understand that. But the error has nothing to do with cursoradaptor.

Having created the cursor that you show, if you execute your command:

SELECT a+b AS description,0.00 AS Price, "Ok" AS Buy FROM list

.. you will get the same error result.

------------
This code doesn't work
------------

If you add the UseMemoSize property that I suggested, you will not see the error.

Alternatively, in your real scenario, you would create an appropriate view and set appropriate properties on the view.
CREATE CURSOR  List ( a m(1),b C(1))

SELECT List 
APPEND BLANK 
REPLACE A WITH SPACE(300)
APPEND BLANK 
REPLACE A WITH SPACE(300)


oCursor = CREATEOBJECT("Products")
oCursor.cCursor = "List"
oCursor.UseMemoSize = 1

IF oCursor.CURSORFILL(.T.,.T.) 
	BROWSE 
ELSE
	aerror(laErrors)
	messagebox(laErrors[2])
ENDIF 

DEFINE CLASS Products AS cursoradapter 

	cCursor = ""

	Alias = "PriceList"
	SendUpdates = .F.
	DataSourceType = "Native"

	SelectCmd = [SELECT a+b AS description,0.00 AS Price, "Ok" AS Buy FROM (THIS.cCursor)]

	cursorschema = "description M,prix Y,achat C(50)"

ENDDEFINE
>L<
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform