Forums

This topic is locked

Update + Redirect

Posted 13 Nov 2002 09:48:55
1
has voted
13 Nov 2002 09:48:55 Q Qwerty posted:
Someone knows whats wrong with the following code? I need to update the field "Clicks" with 1 if a certain parameter is passed and after that to redirect to a specified URL.

<pre id=code><font face=courier size=2 id=code>
&lt;%
If (Request.QueryString("ID" &lt;&gt; "" And (Request.QueryString("CatID" = "1" Then
rsProdukten("Clicks" = rsProdukten.Fields.item("Clicks" + 1
rsProdukten.Update
Response.Redirect(rsProdukten.Fields.Item("URL".Value)
End If
%&gt;
</font id=code></pre id=code>

Translated from IIS Dutch it shows something like the following error message:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
ADODB.Recordset (0x800A0CB3)
Updating is not supported by the current recordset. This can be a limitation by the service of the selected type of locking.
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Replies

Replied 13 Nov 2002 16:16:49
13 Nov 2002 16:16:49 Stefan P replied:
If I understand what you're trying to achieve with the updating of field 'clicks', you need to use Data Binding &gt; Command (Stored Procedure) and write some SQL similar to this:

UPDATE Produkten
SET clicks = clicks + 1
WHERE ID = something

Regards

Stefan

UD4 | ASP | VBScript | ACCESS | IIS5
Replied 13 Nov 2002 16:42:04
13 Nov 2002 16:42:04 Julio Taylor replied:
I think this is an issue with the Recordset Type you're using. some recordsets are locked and cannot be updated (snapshot i think). look in to recordest types (dynaset, snapshot and one more i don't remember which) i think that's where the problem is. are you using access?

------------------------
Julio

PHP | MySQL | UD4

ICQ: 19735247

Reply to this topic