cjkenworthy
Programmer
I'm trying to do an update loop in ASP using the following code:
dim objRS
set objRS = Server.CreateObject("ADODB.Recordset"
objRS.ActiveConnection = MM_UNCL_telecom_STRING
for I=0 to size
dim strSQL
strSQL = "UPDATE NGN SET termination_no = '" & TERMNOarray(I) & "', sale_price = " & PRICEarray(I) & " WHERE NGN_number = '" & NGNarray(I) & "'"
objRS.Open strSQL
next
Set objRS = Nothing
objRS.Close
The values going into the array are correct, I'm 100% sure of this, as I can output them. The problem is that this does update the database but the loop only appears to work once, it only updates one record so if i have:
Record 1:
TERMNOarray(value1), PRICEarray(value1), NGNarray(value1)
Record 2:
TERMNOarray(value2), PRICEarray(value2), NGNarray(value2)
etc..
It only does Record 1.
Can anyone advise? Thanks.
dim objRS
set objRS = Server.CreateObject("ADODB.Recordset"
objRS.ActiveConnection = MM_UNCL_telecom_STRING
for I=0 to size
dim strSQL
strSQL = "UPDATE NGN SET termination_no = '" & TERMNOarray(I) & "', sale_price = " & PRICEarray(I) & " WHERE NGN_number = '" & NGNarray(I) & "'"
objRS.Open strSQL
next
Set objRS = Nothing
objRS.Close
The values going into the array are correct, I'm 100% sure of this, as I can output them. The problem is that this does update the database but the loop only appears to work once, it only updates one record so if i have:
Record 1:
TERMNOarray(value1), PRICEarray(value1), NGNarray(value1)
Record 2:
TERMNOarray(value2), PRICEarray(value2), NGNarray(value2)
etc..
It only does Record 1.
Can anyone advise? Thanks.