>This has got to be something most people already know - sorry if it's a dumb ?. (UT KB and FAQs have nothing on this...)
>
>On a form is a page with a ListBox. The list box data source is an SQL statement. But, when I'm entering the actual statement, VFP 5.0 truncates at 256 chars! Argh! Is this 'unchangeable' behaviour or am I missing something (the docs are of no help)? Surely 256 characters for an SQL statement is way too few?
>
>-Arne
As David alluded to, the property sheet will only support 256 characters (although I think it's actually 254, but that's another thing). Another way to handle this is to store the SQL in a memo field of a "control" table. We have an object (called amazingly enough Control) that steps and fetching systemic operational data for the system to run. Then some very simple code in the init of the control (listbox) gets it going.
*/ MyForm.MyListBox.Init()
IF NOT oControl.GetValue(THIS.name, "MyCursor", THISFORM.DataSessionID)
MESSAGEBOX("It all went out the window")
RETURN 0
ENDIF
*/ Macro substitute the results in the cursor to fire the SQL
*/ This is much less kludgy if getting data from SQL Server
&MyCursor.Value
THIS.RowSourceType = (Alias) [Sleep deprived brain thinks it's 2 but could be wrong]
THIS.RowSource = "Cursor Created by SQL Statement"
THIS.Refresh() && Just to make sure it doesn't forget to do it.
*/ Done ...
In the Control.DBF, a row exists that contains ...
GROUPNAME PROPNAME mVALUE
========= ========= ===============
MyForm MyListBox Memo (Containing the SQL Statement)
Like I said, for SQL Server the code looks better because instead of the macro substitution I fire a SQL passthrough, but this works.
Regards,
J.
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage