[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-developers] SOLVED Two erros - Recordset is read-only & unsupported locktype



Todd,
Congrats on solving it. I have a suggestion on how to better do your update
with better performance and avoid the locking issue. Use an Insert statement
instead of the addnew.  Performance will be better and will help avoid
locking contentions if there are multiple users on the site (this is more
true for record edits than new records but the priciple is sound).

stParm=Replace(rsProducts__MMColParam, "'", "''")  'Fix the BuyBreak String
for i=0 to ubound(productarray) 'Start Looping
	if len(trim(productarray(i))) > 0 then
		'Build the SQL Statement
		sql="Insert into PRODUCTS (PRODUCTID, UNITPRICE, QUANTITY, BUYBREAK )
values("
		sql=sql + "'" + Replace(trim(productarray(i)), "'", "''")  + "', "
		sql=sql + "'" + Replace(trim(descrarray(i)), "'", "''")  + "', "
		sql=sql + trim(pricearray(i)) + ", "
		sql=sql + "'" + stParm + "'"
		sql=sql + ")"
		'Execute the statement
		rsProducts.ActiveConnection.execute sql
	end if
next

Leigh

> -----Original Message-----
> From: cobalt-developers-admin@xxxxxxxxxxxxxxx
> [mailto:cobalt-developers-admin@xxxxxxxxxxxxxxx]On Behalf Of Todd Kirk
> Sent: Thursday, September 05, 2002 12:53 AM
> To: cobalt-developers@xxxxxxxxxxxxxxx
> Subject: RE: [cobalt-developers] SOLVED Two erros - Recordset is
> read-only & unsupported locktype
>
>
> Silly me...
>
> It was the line 'rsProducts.CursorType = 0' Just needed to be a value of
> 3.
>
>
> regards,
>
> Todd Kirk
> > Hi all,
> >
> > Trying to make a page that has products with a text box for entering
> > quantity to order and do a multiple insert (as example on Charoncart
> > website). When I hit the submit button I get the error 'Recordset is
> > read-only'. I have tried change my 'rsProducts.LockType = 3'
> > to 1, 2, 3
> > and 4 values. 1,2 & 3 values give the same error of 'recordset is
> > red-only' but when I use the value of 4 the error is 'unsupported lock