Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

insert data into sql database where the values are in an array

$
0
0

Hello Experts,

using vbscript i want to store data in MS SQL. i have prepared a script which works fine when i provide the static value but in actual i get the values in an array and now want to store values from there.

Below is not complete code but the block in question.

oRecordset_Working.Open "INSERT INTO tbl_work (release, version, state, Arch)" & _"VALUES ('5.2', '11.25' , 'Active', 'XYZ')", _
oConnection, adOpenStatic, adLockOptimistic

i verified the database and can see the information is feeded.

What i really want to make work is:

for i=0 to UBound (arrValues)
oRecordset_Working.Open "INSERT INTO tbl_work (release, version, state, Arch)" & _"VALUES ('arrValues(i)')", _
oConnection, adOpenStatic, adLockOptimistic
Next

logically it is incorrect as INSERT query comes inside the loop but then how can someone make it work?

can someone help me with this?


-KAKA-



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>