Update a table

Results 1 to 3 of 3

Thread: Update a table

  1. #1
    minni Guest

    Default Update a table

    I am trying to update a Cutsomers table with the following code.<BR>&#060;%<BR>Set Conn = Server.CreateObject("ADODB.Recordset")<BR> query = "Select * from customers where customer_ID = " & Cint(Request.QueryString("custID"))<BR>objRS.Open query,Conn,2,3,2 &#039 2-adOpenDynamic, 3-adLockOptimistic, 2-adCmdTable<BR> If Not objRS.EOF then<BR> objRS.Fields("Name") = Request.QueryString("cust_name")<BR> objRS.Fields("Customer_code") = Request.QueryString("cust_code")<BR> objRS.Update<BR> End if <BR>%&#062; <BR><BR>But I get the following error.....<BR>Microsoft VBScript runtime error &#039 800a01a8&#039 <BR><BR>Object required: &#039&#039 <BR>WHY?? Plese help me and THANK YOU!!<BR><BR>

  2. #2
    Linda N. Guest

    Default RE: Update a table

    I don&#039t know if this helps or not but I don&#039t see why you couldn&#039t just do...<BR><BR>objRS("Name") = Request.QueryString("cust_name")<BR>objRS("Custome r_code") = Request.QueryString("cust_code")<BR><BR>...instead of using objRS.Fields. That might be the object it is looking for.<BR><BR>--Linda<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Update a table

    You need to create the objects before you can use them. I think you want something like this...<BR><BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Set objRSrver.CreateObject("ADODB.Recordset")<BR>query = "Select * from customers where customer_ID = " & Cint(Request.QueryString("custID"))<BR>objRS.Open query,Conn,2,3,1&#039 2-adOpenDynamic, 3-adLockOptimistic, 2-adCmdText<BR>&#039probably don&#039t need dynamic membership

Posting Permissions

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