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_textundernea th") = 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
i am updating record using the following method
shopopendatabase myconn
Set objRS = Server.CreateObject("ADODB
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"
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_textundernea
objrs("banner_newwindow") = banner_newwindow
objrs("banner_active") = banner_active
objrs("banner_startdate") = banner_startdate
objrs("banner_enddate") = banner_enddate
objrs("banner_impressions"
objrs("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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
do you have "on error resume next" anywhere on your page?
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
i also don't have any error running the script
the record is not updated
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
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
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!
ASKER