Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using cursoradapter
Message
 
 
To
07/08/2018 11:24:11
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01661443
Message ID:
01661492
Views:
47
>>>>Is there the possibility to change at runtime the selectcmd property? To reduce the number of fields I need every time to change my select command. Alternatively I have to set every time a select * command that is not the best solution... Someone can give me a suggest.?
>>>
>>>Add properties that specify the fields you need, build the select command in .beforeCursorFill() using these properties and call .CursorFill()
>>>
>>>
>>>oCAD = getCursorAdapter(…)
>>>oCAD.FieldsNeeded = '…'
>>>oCAD.cursorFill() && .beforeCursorFill() re-builds the selectCmd using .FieldsNeeded
>>>…
>>>oCAD.cursorRefresh()
>>>
>>
>>I tried with this code:
>>
>>
>>LPARAMETERS luseCursorSchema, lNoDataOnLoad, cSelectCmd
>>
>>*!* In my base cursorAdapter class i have Select * From Table
>>*!* Here i can set a different kind of query reducing the number of fields
>>*!* for example: select id from Table
>>If !Empty(This.CustomSelect)
>>	cSelectCmd = This.CustomSelect
>>EndIf
>>
>>*!* Here i can set a where condition 
>>If !Empty(This.CustomWhere)
>>	cSelectCmd = cSelectCmd + " Where " + This.CustomWhere
>>EndIf
>>
>>Return dodefault(@m.lUseCursorSchema, @m.lNoDataOnLoad, @m.cSelectCmd)
>>
>>
>>
>>Setting a custom where condition it works....
>>
>>i have
>>
>>cSelectCmd = "select * from anag where id<100"
>>
>>
>>If, instead, i set a different select command the cursor is not returned....
>>cSelectCmd is apparently set correctly
>>
>>I have
>>
>>cSelectCmd = "Select id from anag where id<100"
>>
>>What did i miss ?
>
>cursorAdapter errors are always silent, you need to see aError() -- if you have FoxInCloud loaded, you can use caError():
>
>if not oCAD.cursorFill()
> ? caError() && wrapper around aError()
>endif
>
The error i have is:
Invalid update column name "TPAN"
where TPAN is the first column of my table, that is not included in my custom "select" command....

I solved temporarly the problem setting "UpdatableFieldList" and "UpdateNamelist" to empt y value
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform