|
Subject:
|
updating table
|
|
Posted By:
|
markhardiman
|
Post Date:
|
9/29/2004 5:29:03 AM
|
hi all i have the following code
Set pb_RS=Server.CreateObject("ADODB.Recordset") pb_SQL = "SELECT * FROM web_1 WHERE web_num= '" & SESSION("web_num") & "'" pb_RS.Open pb_SQL, objConn, , adLockOptimistic
pb_RS.Fields("web_pb").value = SESSION("Valid") pb_RS.Fields("web_pdate").value = Date pb_RS.Fields("webr_stage").value = "Claimed" pb_RS.Update
pb_RS.Close Set pb_RS= Nothing
and i am trying to update a record already in a table. however when this code is run it changes the values for all records in the table. any ideas whats happening?
Slán ~M ____ Mark
|
|
Reply By:
|
happygv
|
Reply Date:
|
9/29/2004 9:49:15 AM
|
Try to response.write SESSION("web_num"), and see if that hold any value.
A better way is to try this.pb_SQL = "SELECT * FROM web_1 WHERE web_num= '" & SESSION("web_num") & "'"
Response.write pb_SQL
Response.end
pb_RS.Open pb_SQL, objConn, , adLockOptimisticNow copy/paste the resulting SQL statement and execute that on query analyser and see what it results, that would give you some idea on what is going wrong. Also confirm if you are using any Loop to do your update there.
Hope that helps. Cheers!
_________________________ - Vijay G Strive for Perfection
|
|
Reply By:
|
iniro
|
Reply Date:
|
9/29/2004 12:35:18 PM
|
well if i was you i would have used update query to do the job. i find it easier to work with.
pb_SQL="update web_1 set web_pb ="' & session("Valid") & "',web_pdate='" & date & "',webr_stage=""Claimed"" where web_num='" & session("web_num") & "'"
pb_RS.open pb_sql,objConn
i think this should work
|