Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot update properly.

Status
Not open for further replies.

vintl

Technical User
Jun 9, 2000
72
0
0
MY
What i'm trying to do here is to update the book for each user input PID.
the problem is why i'm unable to update the rest of record, but only able to update the first record?
there is no effect when i try to update other PID, but only able to update the first PID record on db.
below is the code.

Set DB = Server.CreateObject ("ADODB.Connection")
DB.Mode = adModeReadWrite
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + "C:\...abc.db")
Set RS = Server.CreateObject ("ADODB.Recordset")
SQL = "SELECT * FROM Reserve WHERE RID = 'Request(txRID)'"
'RS.Open "SELECT BID,RID FROM Reserve WHERE RID = 'Request(txRID)'", DB, adOpenStatic, adLockPessimistic
RS.Open "Reserve", DB, adOpenStatic, adLockPessimistic
RS ("BID") = Request("Book")
RS.Update
 
That is because you are not trying to update a particular record. Everytime you are updating only first record. If you want to update all the records, run it in the loop or use SQL update query rather than using Recordset's update method.

Hope this helps

Thanks
Hitesh
 
I do not want to update all the records. I only want to update the record that the user specify by inputing the RID number. So each time, the user can only update 1 record according to the user preference on the PID number which exist only if the user had inserted a new record, whereby the RID is auto increment everytime a record is inserted. now i can only update the first record according to sequence in the db, but not the rest of the record that exist.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top