Avatar of humer2000
humer2000
 asked on

updating records using rs.update method

hi experts,

i am updating record using the following method

shopopendatabase myconn
            Set objRS = Server.CreateObject("ADODB.Recordset")
            objrs.open "select * from bm_bannerstbl where banner_id="&id, myconn, adopenkeyset, adlockoptimistic, adcmdtable
            objrs("banner_accountid") = banner_accountid
            objrs("banner_zoneid") = banner_zoneid
            objrs("banner_name") = banner_name
            objrs("banner_description") = replace(banner_description,"'","''")
            objrs("banner_targeturl") = banner_targeturl
            objrs("banner_imageurl") = banner_imageurl
            objrs("banner_alttext") = banner_alttext
            objrs("banner_width") = banner_width
            objrs("banner_height") = banner_height
            objrs("banner_border") = banner_border
            objrs("banner_textunderneath") = banner_textunderneath
            objrs("banner_newwindow") = banner_newwindow
            objrs("banner_active") = banner_active
            objrs("banner_startdate") = banner_startdate
            objrs("banner_enddate") = banner_enddate
            objrs("banner_impressions") = banner_impressions
            objrs("banner_weightings") = banner_weightings
            objrs("banner_tpbanner") = bmfalse
            objrs.update
            objrs.close
            shopclosedatabase myconn

But it's not working and my records are not updated, why ?
what's the problem with my code ?
please help
thx


ASP

Avatar of undefined
Last Comment
WMIF

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Cem Türk

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
jitganguly

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
humer2000

ASKER
none of them worked
WMIF

do you have "on error resume next" anywhere on your page?
humer2000

ASKER
nope, i don't have "on error resume next"
i also don't have any error running the script
the record is not updated
Your help has saved me hundreds of hours of internet surfing.
fblack61
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
humer2000

ASKER
i obtain id sent ok
but not doing update
this means that my error is in  objrs.open "select * from bm_bannerstbl where banner_id="&id, myconn, adopenkeyset, adlockoptimistic, adcmdtable
humer2000

ASKER
i found the solution here in EE forums
the problems is the cursor type

i should put   objrs.open "select * from bm_bannerstbl where banner_id="&id, myconn, 1, 3
instead of
  objrs.open "select * from bm_bannerstbl where banner_id="&id, myconn, adopenkeyset, adlockoptimistic, adcmdtable

i will split the points and give you some :)
thx
WMIF

good work!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.