I have a list of numbers formatted as such: ######_#######.
These are populated via a text box and then displayed in a list box.
Upon hitting a submit button, all of the values are stored in an array and are supposed to be run through an sqlExecute statement.
Here is what I have: (This is the action event handler of the button)
Dim sampleid as String
dim results() as String
for i as integer = 0 to lstboxIDS.ListCount - 1
sampleid = lstboxIDS.Cell(i, 0)
results.append(sampleid)
next
sqlUpdate = "UPDATE *tablename* SET racknumber = " +
finalRackName.SQLQuote + " WHERE sampleid = " + sampleid.SQLQuote
connectDB("*dbname*")
If mDB.Connect then
mIsConnected = true
mDB.SQLExecute("SET NAMES 'utf8'")
for each sample as string in results
//update DB
//MsgBox(sample)
mDB.SQLExecute(sqlUpdate)
if mDB.Error then
MsgBox("Error: " + mDB.ErrorMessage)
end if
next
else
mIsConnected = false
msgBox("Connection error: " + mDB.ErrorMessage)
end if
I’ve stepped through the code in the debugger and each time through the for loop it grabs the same number, whether there are 3 or 15 numbers. And that is the only number that gets properly updated in the table.
The message box will show each and every number in the array, however.
I’m stumped!