Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL AND INSERT IN AN ACCESS DB
Message
From
24/12/1998 14:39:31
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00170282
Message ID:
00170357
Views:
12
>>>>>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
>>>
>>>Thanks a lot for the Idea, now what happens whenever you find a Numeric
>>>value with decimals,, it will give you an error isn't it?
>>>now how do you determine whether is a num value or not... Dohhh!! <-- ahead of time
>>>
>>>mark
>>
>>But actually I figure it that one out already,,,but
>>Is there a way to concat a string value and a logical value together:
>>x='hello'+.f. perhaps...It is giving me errors
>>
>>mark
>
>x='hello'+IIF(logicalvar,'.T.','.F.') or whatever strings you want for
true/false representation.

Thanks .. I fix it already,, The concat string is working, but I have about
138 fields to update,, and the values .. when I issue the len() on the string
variable the lenght is about 135x something,, and the SQL commands are returning
-1 no table update..
then there is a limitation whenever I am trying to pass a SQL command as a variable string or perhaps I am not doing it right..

any comments..

mark
Previous
Reply
Map
View

Click here to load this message in the networking platform