The Maximum # of characters per command line is 8,192. See 'Visual FoxPro System Capacities' in the help file.
In case like that you can try to split one big select into multiple selects. For example, first select would include Where and Order By clause but select all fields into cursor. The second one would select only requested fields from the first cursor.
>I have mySQLString to hold the SQL SELECT statement that the user builts. mySQLString varies in length, depending on what user wants. Sometimes this string can grow really long (user selects many fields, many filters & sort order). Once mySQLString is built, I use &mySQLString to execute the SELECT Statement built in mySQLString.
>
>Example:
>mySQLString='SELECT * FROM myTable'
>&mySQLString
>
>This works fine if mySQLString is of reasonable length. But when it gets very lengthy, I get 'String too long to fit' error (user can customize mySQLString so that mySQLString changes all the time). I've read somewhere that the max. length of command literal is 8000 bytes. How do I get around this?
>
>Thanks all!
--sb--