Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Rajesh Halyal
  Where is Rajesh Halyal?
 SANGLI
 India
 Rajesh Halyal
 To: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
Subject: RE: how to create a string of values that can be used to insert in SQL server
Thread ID: 110551 Message ID: 110674 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Saturday, October 21, 2006 4:39:39 AM         
   



I think this what I wanted. I will go trough it soon.
Its Diwali Festival in India (Festival of ligths) so

***************************
***************************
Happy Diwali & Prosperous New Year (Hindu Calander).
***************************
***************************

Rajesh

> > 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 Halyal

>
>
> Hi,
> Please read my thread: http://www.foxite.com/archives/0000108058.htm
> In 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 ...




-----------------------------------
Rajesh Halyal

ENTIRE THREAD