Help Help Help
This is one of those 4-hour problems. Here is what is happening - the code executes just fine, it goes through the Do-While loop just fine, it generates the correct UPDATE statements just fine, BUT, it only executes the UPDATE statement the first time through and updates the first record only. WHY? The code snippet is below:
X = 0
LANGUAGE = Request("LANGUAGE")
TID = Split(Request("TRANS"),",")
EID = Split(Request("ENG"),",")
UPPER = Ubound(TID)
Set Conn = Server.CreateObject("ADODB.Command")
Conn.ActiveConnection = "DSN=xxxxxx;UID=;pwd=;"
Do Until X > UPPER
'---------- COMMIT CHANGES TO THE DATABASE -----------
Conn.CommandText = "UPDATE Translations SET Translation='" & Replace(TID(X),"'","#39;") & "' WHERE LANGID='" & LANGUAGE & "' AND English='" & EID(X) & "'"
Conn.Execute
X = X + 1
Loop
Conn.ActiveConnection.Close
Response.Write X & " records committed"
The more I learn, the less I know.
|