Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3999218
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:37:44+00:00 2026-05-20T07:37:44+00:00

How does the code below work? I’ve never seen an UPDATE done this way.

  • 0

How does the code below work? I’ve never seen an UPDATE done this way. I always do it this way:

http://www.w3schools.com/sql/sql_update.asp


sqlText = "SELECT * FROM pricing WHERE pid=1"
rsx.Open sqlText, cnx, 1, 2

if Not rsx.EOF then

    rsx("new_us") = Request.Form("new_us")
    rsx("new_us_desc") = Rtrim(Request.Form("new_us_desc"))
    rsx("new_ca") = Request.Form("new_ca")
    rsx("new_ca_desc") = Rtrim(Request.Form("new_ca_desc"))
    rsx("new_int") = Request.Form("new_int")
    rsx("new_int_desc") = Rtrim(Request.Form("new_int_desc"))
    rsx("conv_us") = Request.Form("conv_us")
    rsx("conv_us_desc") = Rtrim(Request.Form("conv_us_desc"))
    rsx("conv_ca") = Request.Form("conv_ca")
    rsx("conv_ca_desc") = Rtrim(Request.Form("conv_ca_desc"))
    rsx("conv_int") = Request.Form("conv_int")
    rsx("conv_int_desc") = Rtrim(Request.Form("conv_int_desc"))
    rsx("ren_us") = Request.Form("ren_us")
    rsx("ren_us_desc") = Rtrim(Request.Form("ren_us_desc"))
    rsx("ren_ca") = Request.Form("ren_ca")
    rsx("ren_ca_desc") = Rtrim(Request.Form("ren_ca_desc"))
    rsx("ren_int") = Request.Form("ren_int")
    rsx("ren_int_desc") = Rtrim(Request.Form("ren_int_desc"))
    rsx.Update

end if

rsx.Close
cnx.Close

Set rsx = Nothing
Set cnx = Nothing

Thanks

Brett

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:37:44+00:00Added an answer on May 20, 2026 at 7:37 am

    First you execute the query with rsx.Open. cnx is the connection to the db, parameter value 1 is CursorType = adOpenKeyset and parameter value 2 is LockType = adLockPessimistic.

    sqlText = "SELECT * FROM pricing WHERE pid=1"
    rsx.Open sqlText, cnx, 1, 2
    

    rsx is a Recordset (com object) that holds the returned rows. if Not rsx.EOF then checks that you actually got at least one row, otherwise the edit will fail.

    This rsx("new_us") = Request.Form("new_us") assign new values to fields in the Recordset.

    Finally rsx.Update saves the modified fields to the db. The OLE DB Provider used by cnx builds the update statement that is sent to the database.

    So basic work flow is:

    1. Fetch a row from db
    2. Modify row
    3. Send the row back to db
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone explain to me why this code below does not work? #include opencv/cv.h
Update: The code below does indeed work as expected, and accomplishes the code I
Not sure how to do this. The code below does not work. From the
In the code below, why does the open function work but the close function
In the below code sample, what does {0:X2} mean? This is from the reflection
Why below code does not work: $('button[name=publish]', 'button[name=cancel]').live('click', function(){ alert('ddddd'); }); The html is
I have the below code that does not seem to work at all :(
How does the below code work? class A { int a = 10; }
For some reason this PHP code below will not work, I can not figure
The code shown below does work because the method values() is static. My question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.