Your best bet is to use stored procedures, that will take care of the length problem, and seems to be the most recommended method anyway. I ran into similar problems but it was usually because I stored the source in a property of a VFP object, so I had to break up statements in 2 or 3 properties and turned them into one statement wich I would place in Recordset.Source at runtime, still you're better off working with stored procedures IMO.
>I am still messing with ADO for my VFP to SQL Server application and am starting to run into some problems when long (500 or so character) strings are assigned to things like RecordSet.Source or Command.commandText.
>
>I have statements like "select -a number of fields- from x where -big where statement-" which works great until the total number of characters reaches just under 500. Then the statment appears to be chopped off and I get an invalid statement SQL error. I'm trying to avoid transfering more data than I have to do I'd rather not do the filtering on the client.
>
>Are such ADO limits documented somewhere? Is there a way to break things up (separate the field list from the where clause)? Is there an ADO technique which allows larger strings? Should I bag it and use SQL passthrough which I don't know anything about...
>
>Thanks again,
>Pat
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only