Link to home
Start Free TrialLog in
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


ASKER CERTIFIED SOLUTION
Avatar of Cem Türk
Cem Türk
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of humer2000
humer2000

ASKER

none of them worked
do you have "on error resume next" anywhere on your page?
nope, i don't have "on error resume next"
i also don't have any error running the script
the record is not updated
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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
good work!