Click to See Complete Forum and Search --> : Current


screaming_banjo
02-15-2005, 09:14 AM
Hi

I'm getting this error:
ADODB.Recordset error '800a0cb3'

Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.

/rogues.asp, line 82

I'm using adlockoptimistic and thought that was acceptable, here's the code that I have:

Set rsRogDetail = Server.CreateObject("ADODB.Recordset")
rsRogDetail.Open "SELECT * FROM tblRogDetail WHERE rogID= "& request("rogID") &" ORDER BY rogContact", conn, adOpenKeyset, adLockOptimistic

IF request("cmdUpdate") > "" then
rsRogDetail("rogContact") = request("txtRogName") Line 82
rsRogDetail("rogContactEmail") = request("txtEmail")
rsRogDetail("rogBusTel") = request("txtBusTel")
rsRogDetail("rogMobTel") = request("txtMobile")
rsRogDetail.update
END IF

Is it anything to do with the 'Order by', can I not have an 'order by' if I'm updating the recordset?
Thanks

russell
02-15-2005, 12:37 PM
adLockBatchOptimistic is probably what u want, but it depends on the provider. here are the lock types (http://msdn.microsoft.com/library/en-us/ado270/htm/mdcstlocktypeenum.asp?frame=true) but i'd suggest that u use an UPDATE query instead of recordset updating.

screaming_banjo
02-15-2005, 05:24 PM
Hi

Thanks for your reply. One problem though, I'm fairly new to ASP and this is the only way I know how to update a recordset. What do you mean by using an update query?

I presume this is something I need to do in Enterprise Manager?

Can you give me a wee bit more advice please. Again I've only been taught by the trainer to use adlockoptimistic or adlockreadonly but I'll give this a go when I'm back in work tomorrow.......all the lock type stuff is a bit hard to get your head round:)

kmalone
02-15-2005, 05:33 PM
An example of an update query in your case:

conn.execute "update tblRogDetail set rogBusTel='"&request("txtBusTel")
&"', rogMobTel='"&request("txtMobile")&"' WHERE rogID= "& request("rogID")


i think i missed a column, but can't see the original code while editing for clarity.

for further help with sql statements, check:

w3schools sql (http://www.w3schools.com/sql/default.asp)