Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursor adaptor - string is too long to fit .. in a memo
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00852723
Message ID:
00852820
Vues:
8
Marcel, here's what I'm trying to say:

* -- either your real data is native or it is not. I can't tell from your example where it is really coming from, as I said previously.

* -- if it is not native, you should handle it previously to getting to this point, and we've already discussed how.

* -- if it is native, you have abundant ways to create a view or other temporary holding places for the data that will have the concatenated data available to you. You just can't do it directly in the SELECT statement -- and this error doesn't have anything to do with the cursoradapter class <s>.

Does this make sense to you?

How you do it in native data depends on WHAT YOUR ORIGINAL TABLES look like.

For example, if List.a is really a memo field (I still don't know if it is!) you could forget all about cursorschema and just do the following.
CREATE CURSOR  List ( a m,b c(1))

SELECT List 
APPEND BLANK 
REPLACE A WITH REPLICATE("this is a test",300), b WITH 'F'
APPEND BLANK 
REPLACE A WITH SPACE(300) , b WITH 'F'

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

IF oCursor.CURSORFILL() 
    replace ALL a WITH a+b
	BROWSE 
ELSE
	aerror(laErrors)
	messagebox(laErrors[2])
ENDIF 

DEFINE CLASS Products AS cursoradapter 

	cCursor = "List"

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

	SelectCmd = [SELECT * , $0.00 AS Price, "Ok" AS Buy FROM (THIS.cCursor)]


ENDDEFINE
If, OTOH, List really has a *character* field for a rather than a memo field for the field a, then you would want to do it this way, using the properties I have suggested:
CREATE CURSOR  List ( a c(200),b C(1))

SELECT List 
APPEND BLANK 
REPLACE A WITH REPLICATE("this is a test", 300), b WITH 'F'
APPEND BLANK 
REPLACE A WITH SPACE(300) , b WITH 'F'

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

IF oCursor.CURSORFILL(.T.) 
    replace ALL description WITH description+b
	BROWSE 
ELSE
	aerror(laErrors)
	messagebox(laErrors[2])
ENDIF 

DEFINE CLASS Products AS cursoradapter 

 cCursor = "List"
 Alias = "PriceList"
 SendUpdates = .T.
 DataSourceType = "Native"

 SelectCmd = [SELECT a AS description,b , $0.00 AS Price, "Ok" AS Buy FROM (THIS.cCursor)]
 cursorschema = "description M,b c(10), prix Y,achat C(50)"

ENDDEFINE
There are probably a whole host of other methods, but a trivial example won't tell me which is the right one. It all really depends on WHERE YOUR DATA REALLY COMES FROM, which I can't see in the example <s>.

OK?

>L<
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform