> I am trying to create a string depending on the cursor fields & its
> type to be used to pass it to insert command for SQL server.
> I am having 2 problems
> 1> How to include character fields with quotes, square brackets & other
> special characters.
> 2> How to send date fields.
> -----------------------------------
> Rajesh HalyalHi,
Please read my thread:
http://www.foxite.com/archives/0000108058.htmIn this I have the generic code for both INSERT and UPDATE, and the
UPDATE string is only added to the update syntax if in fact the
field value has been changed.
The INSERT function does exactly what you want it to do and that
is generically dynamically build a field list and a value list
based upon a local VFP cursor that was created via a SQL-Select
statement against a SQL-Server backend table.
You will notice in the source code the correct conversions have been
made to the strings to hamdle; character, datetime, integer, decimal,
and memo fields.
You will see within the same threads the a DELETE function is also
shown two threads below the thread identified above.
I coded this as I was just sick and tired of entering in large field
and value strings with SQL-Server backend table with many tables
containing over 70-80 fields.
Using generic functions like this will save you a lot of hours in
typo errors and frustration.
Pete from the Great White North. (Only in Canada, ay.) Over and Out ...