Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL AND INSERT IN AN ACCESS DB
Message
From
24/12/1998 12:58:35
 
 
To
24/12/1998 12:21:22
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00170282
Message ID:
00170322
Views:
21
>Thanks for your help Tom, now is there a way to loop thru the array and put the
>values in , EXAMPLE something like:
>
>INSERT INTO MERCHANT VALUES(FOR I TO LENARRAY;ARRAY(I)) OR
>I HAVE TO WRITE EVERY SINGLE ONE

Sure... you can build the select string into a variable by looping throught the array....

lcSqlString = "INSERT INTO MERCHANT VALUES ("

for i = 1 to alen(MyArray)
lcSqlString = lcSqlString + " '"+MyArray[i]+"' "
if i < alen(MyArray)
lcSqlString = lcSqlString + ","
endif
next i
lcSqlString = lcSqlString+")"

*** I would view the lcSqlString here to make sure it is right.
* but the above is the basic idea.

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform