Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating using rs.Update

Status
Not open for further replies.

cawi17

IS-IT--Management
Oct 25, 2002
18
0
0
MY

I'm trying to update a record by using rs.Update.. Though, it produces error

Error Type :
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.



.....

Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.RecordSet")

dataConn= "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("cd2buy.mdb")
cn.open dataConn


sqlstring = "SELECT * FROM CART WHERE CART.Customer_User_Name='" & Session("username") & "'"
rs.Open sqlstring,cn



.....


For i = 0 To UBound(quantityarray)

rs("Quantity") = quantityarray(i)
rs.Update

rs.Movenext
next

......

Thank you...
 
with no cursortype specified here
Code:
rs.Open sqlstring,cn

it will default to a ForwardOnly which is a readonly type

use
Code:
RS.Open sqlstring, cn, adOpenStatic, adLockReadOnly, adCmdText


Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Thanks ChrisHirst,

I got tired of trying all types of locks and cursortypes, and finally I used another SQL query to update the records. It worked.... I'll try the Cursor Type and lock you gave me.... At least I know now...

Thanks guyz for helping...

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top