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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using RecordSet.Update for an Oracle table through ASP

Status
Not open for further replies.

Jonine

Programmer
Sep 28, 1999
8
0
0
US
Visit site
Hello guys,<br>
<br>
Has anyone managed to do an update on an Oracle 8 table using the Update method of the ADODB Recordset object?<br>
Can anyone tell me what I'm doing wrong in :<br>
<br>
&lt;!--#include virtual=&quot;/include/adovbs.inc&quot;--&gt;<br>
&lt;%<br>
Dim adoCon<br>
Dim rsUnixLogon<br>
Set adoCon = Server.CreateObject(&quot;ADODB.Connection&quot;)<br>
strCon=&quot;DSN=WT;UID=linc;PWD=UNIX;&quot;<br>
adoCon.Open strCon<br>
Set rsUnixLogon = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br>
strSQL=&quot;SELECT FLAG, MIN(UNIXID) FROM UNISURE_CS901 WHERE FLAG=0 GROUP BY FLAG&quot;<br>
rsUnixLogon.CursorType = 1<br>
rsUnixLogon.LockType = 2<br>
rsUnixLogon.Open strSQL, adoCon<br>
If rsUnixLogon.BOF &lt;&gt; True Then<br>
SESSION(&quot;UnixLogon&quot;)=rsUnixLogon(1)<br>
rsUnixLogon(0) = 1<br>
rsUnixLogon.Update<br>
Else<br>
Response.Redirect &quot;UnixLogonError.asp&quot;<br>
End If <br>
rsUnixLogon.Close<br>
Set rsUnixLogon = Nothing<br>
adoCon.Close<br>
Set adoCon = Nothing<br>
%&gt;<br>
<br>
This gives the following error:<br>
ADODB.Field error '800a0cb3'<br>
The operation requested by the application is not supported by the provider.<br>
(The line number indicated by the error is the one reading<br>
rsUnixLogon(0) = 1<br>
<br>
However, if I try to update using the Execute method of the Connection object, this works OK:<br>
<br>
&lt;!--#include virtual=&quot;/include/adovbs.inc&quot;--&gt;<br>
&lt;%<br>
Dim adoCon<br>
Dim rsUnixLogon<br>
Set adoCon = Server.CreateObject(&quot;ADODB.Connection&quot;)<br>
strCon=&quot;DSN=WT;UID=linc;PWD=UNIX;&quot;<br>
adoCon.Open strCon<br>
Set rsUnixLogon = Server.CreateObject(&quot;ADODB.Recordset&quot;)<br>
strSQL=&quot;SELECT FLAG, MIN(UNIXID) FROM UNISURE_CS901 WHERE FLAG=0 GROUP BY FLAG&quot;<br>
rsUnixLogon.CursorType = 1<br>
rsUnixLogon.LockType = 2<br>
rsUnixLogon.Open strSQL, adoCon<br>
If rsUnixLogon.BOF &lt;&gt; True Then<br>
SESSION(&quot;UnixLogon&quot;)=rsUnixLogon(1)<br>
adoCon.Execute &quot;UPDATE UNISURE_CS901 SET FLAG = 1 WHERE UNIXID = '&quot; & SESSION(&quot;UnixLogon&quot;) & &quot;'&quot;<br>
Else<br>
Response.Redirect &quot;UnixLogonError.asp&quot;<br>
End If <br>
rsUnixLogon.Close<br>
Set rsUnixLogon = Nothing<br>
adoCon.Close<br>
Set adoCon = Nothing<br>
%&gt;<br>
<br>
Have also tried using the syntax &quot;Recordset.Fields(fieldname) = value&quot; which gives the same error...<br>
Does anyone have any suggestions? Would be very grateful!<br>
Cheers!<br>
Jonine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top