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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using update

Status
Not open for further replies.

johnaregan

Programmer
Mar 13, 2001
87
To ask a simple question, how do you use the ADO update on a recordset in ASP?
 
First, your recordset must have a lockType declared as something other than the default of adReadOnly(1) --

Then, if you are UPDATEing existing records, just move to the desired record in the recordset, and assign values to the fields like you would for any other variable:

rs("fieldName") = value

and then call the .update method on the recordset:

rs.update

to run the update on the database. If you don't call .update, then the changes are made to the rs, but not the database (since the rs is a snapshot of the data, not the actual data).

If you want to add new records to the rs:

rs.addNew
rs("fieldName") = value
rs.update

works like INSERT does in a pure SQL type solution.

hope that helped! :)
Paul Prewett
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top