Editing Database Records

Results 1 to 2 of 2

Thread: Editing Database Records

  1. #1
    Join Date
    Dec 1969

    Default Editing Database Records

    Hey guys. I&#039;m fairly new to ASP and generally learn by doing, or viewing examples, etc. I&#039;ve got a database driven site and am trying to allow the user the option of adding, deleting, and editing records online. So far I have successfuly accomplished the adding and deleting actions... but I just can&#039;t figure out how to edit a record. I figure that the commands would not differ to much from the add page. The link below has the code for my add page, which is getting data from a form submitted to it. This page works well. Could someone please modify this code to edit, or update a record (the record being updated is identified by the "CarID" submitted by the form)??? I&#039;m at my wits end on making it work, and if someone could just give me a working example it&#039;d help me understand a lot. <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Editing Database Records

    &#060;%<BR>...<BR>&#039; $$$ START by changing the SQL (code above that okay)<BR>&#039;<BR>SQL = "SELECT * FROM Inventory WHERE CarID=" & Request("CarID")<BR>Set RecordSet = Server.CreateObject("ADODB.Recordset") <BR><BR>&#039;-- Cursor Type, Lock Type <BR>&#039;-- ForwardOnly 0 - ReadOnly 1<BR>&#039;-- KeySet 1 - Pessimistic 2<BR>&#039;-- Dynamic 2 - Optimistic 3<BR>&#039;-- Static 3 - BatchOptimistic 4 <BR><BR>RecordSet.Open SQL, DataConnection, 1, 2 &#039; might need to be 3, 2 ???<BR><BR>if Request.Form("txtFeatureCar") = "on" then Feature = "True" else Feature = "False" end if<BR><BR>&#039; just *OMIT* the AddNew...keep the rest the same...<BR><BR>******************************<BR>< BR>You really do *not* need the Command object in either version of the code, you know.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts