Microsoft KB Archive/255707: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "<" to "<")
m (Text replacement - """ to """)
 
(One intermediate revision by the same user not shown)
Line 67: Line 67:
== RESOLUTION ==
== RESOLUTION ==


You must use client-side cursors to perform updates against an Oracle database by using the Microsoft Oracle OLE DB Provider. To do this, before opening the recordset, specify the CursorLocation property to equal '''adUseClient''' (or the number &quot;3&quot;).
You must use client-side cursors to perform updates against an Oracle database by using the Microsoft Oracle OLE DB Provider. To do this, before opening the recordset, specify the CursorLocation property to equal '''adUseClient''' (or the number "3").


</div>
</div>
Line 94: Line 94:
                     </pre></li>
                     </pre></li>
<li><p>Insert the following code into a new Microsoft Active Server Pages (ASP) page:</p>
<li><p>Insert the following code into a new Microsoft Active Server Pages (ASP) page:</p>
<pre class="codesample"><%@ Language=VBScript %&gt;
<pre class="codesample"><%@ Language=VBScript %>
<!--METADATA TYPE=&quot;TypeLib&quot; NAME=&quot;Microsoft Remote Data Services Server 2.5 Library&quot; UUID=&quot;{9381D8F6-0288-11D0-9501-00AA00B911A5}&quot; VERSION=&quot;1.5&quot;--&gt;
<!--METADATA TYPE="TypeLib" NAME="Microsoft Remote Data Services Server 2.5 Library" UUID="{9381D8F6-0288-11D0-9501-00AA00B911A5}" VERSION="1.5"-->
<!--METADATA TYPE=&quot;TypeLib&quot; NAME=&quot;Microsoft ActiveX Data Objects 2.5 Library&quot; UUID=&quot;{00000205-0000-0010-8000-00AA006D2EA4}&quot; VERSION=&quot;2.5&quot;--&gt;
<!--METADATA TYPE="TypeLib" NAME="Microsoft ActiveX Data Objects 2.5 Library" UUID="{00000205-0000-0010-8000-00AA006D2EA4}" VERSION="2.5"-->
<%' Replace the above two lines with the following lines to use MDAC 2.6
<%' Replace the above two lines with the following lines to use MDAC 2.6
'<!--METADATA TYPE=&quot;TypeLib&quot; NAME=&quot;Microsoft Remote Data Services Server 2.6 Library&quot; UUID=&quot;{9381D8F6-0288-11D0-9501-00AA00B911A5}&quot; VERSION=&quot;1.5&quot;--&gt;
'<!--METADATA TYPE="TypeLib" NAME="Microsoft Remote Data Services Server 2.6 Library" UUID="{9381D8F6-0288-11D0-9501-00AA00B911A5}" VERSION="1.5"-->
'<!--METADATA TYPE=&quot;TypeLib&quot; NAME=&quot;Microsoft ActiveX Data Objects 2.6 Library&quot; UUID=&quot;{00000206-0000-0010-8000-00AA006D2EA4}&quot; VERSION=&quot;2.6&quot;--&gt;%&gt;
'<!--METADATA TYPE="TypeLib" NAME="Microsoft ActiveX Data Objects 2.6 Library" UUID="{00000206-0000-0010-8000-00AA006D2EA4}" VERSION="2.6"-->%>
<HTML&gt;
<HTML>
<HEAD&gt;
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;&gt;
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD&gt;
</HEAD>


<BODY&gt;
<BODY>
<%
<%
     Dim cn, rs
     Dim cn, rs
     Set cn = Server.CreateObject(&quot;ADODB.Connection&quot;)
     Set cn = Server.CreateObject("ADODB.Connection")
     Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
     Set rs = Server.CreateObject("ADODB.Recordset")
     cn.Open &quot;Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=YourDataSource;&quot;
     cn.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=YourDataSource;"
     ' rs.CursorLocation = adUseClient ' Uncomment this line to cause this code to work properly.
     ' rs.CursorLocation = adUseClient ' Uncomment this line to cause this code to work properly.
     rs.Open &quot;SELECT * FROM MYACCT&quot;, cn, adOpenKeyset, adLockOptimistic  
     rs.Open "SELECT * FROM MYACCT", cn, adOpenKeyset, adLockOptimistic  
     rs(&quot;ACCT_NUM&quot;)=333
     rs("ACCT_NUM")=333
     rs(&quot;CUST_NUM&quot;)=333
     rs("CUST_NUM")=333
     rs(&quot;ACCT_NAME&quot;)=&quot;barry white&quot;
     rs("ACCT_NAME")="barry white"
     rs.Update  
     rs.Update  


%&gt;
%>


</BODY&gt;
</BODY>
</HTML&gt;
</HTML>
                     </pre></li>
                     </pre></li>
<li>Save the page in a folder that is part of a Web application in Internet Information Server (IIS).</li>
<li>Save the page in a folder that is part of a Web application in Internet Information Server (IIS).</li>

Latest revision as of 13:53, 21 July 2020

Article ID: 255707

Article Last Modified on 9/30/2003



APPLIES TO

  • Microsoft OLE DB Provider for Oracle Server 1.0
  • Microsoft OLE DB Provider for Oracle Server 1.0
  • Microsoft OLE DB Provider for Oracle Server 1.0
  • Microsoft OLE DB Provider for Oracle Server 1.0



This article was previously published under Q255707

SYMPTOMS

When you perform updates or add new records to an Oracle database by using Microsoft ActiveX Data Objects (ADO), the following error may occur:

ADODB.Recordset (0x800A0CB3)
Object or provider is not capable of performing requested operation.

CAUSE

This error message is generated because the Oracle OLE DB Provider does not support server-side updates.

RESOLUTION

You must use client-side cursors to perform updates against an Oracle database by using the Microsoft Oracle OLE DB Provider. To do this, before opening the recordset, specify the CursorLocation property to equal adUseClient (or the number "3").

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

To reproduce this behavior, perform the following steps:

  1. Create a sample table in Oracle with some data by using the following SQL statements:

    CREATE TABLE MYACCT
            (ACCT_NUM   NUMBER  CONSTRAINT pk_Acct_Num PRIMARY KEY ,
             CUST_NUM   NUMBER,
             ACCT_NAME  VARCHAR2(255)) 
    
    INSERT INTO MYACCT VALUES(111,111,'Barry Blue')
                        
  2. Insert the following code into a new Microsoft Active Server Pages (ASP) page:

    <%@ Language=VBScript %>
    <!--METADATA TYPE="TypeLib" NAME="Microsoft Remote Data Services Server 2.5 Library" UUID="{9381D8F6-0288-11D0-9501-00AA00B911A5}" VERSION="1.5"-->
    <!--METADATA TYPE="TypeLib" NAME="Microsoft ActiveX Data Objects 2.5 Library" UUID="{00000205-0000-0010-8000-00AA006D2EA4}" VERSION="2.5"-->
    <%' Replace the above two lines with the following lines to use MDAC 2.6
    '<!--METADATA TYPE="TypeLib" NAME="Microsoft Remote Data Services Server 2.6 Library" UUID="{9381D8F6-0288-11D0-9501-00AA00B911A5}" VERSION="1.5"-->
    '<!--METADATA TYPE="TypeLib" NAME="Microsoft ActiveX Data Objects 2.6 Library" UUID="{00000206-0000-0010-8000-00AA006D2EA4}" VERSION="2.6"-->%>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    </HEAD>
    
    <BODY>
    <%
        Dim cn, rs
        Set cn = Server.CreateObject("ADODB.Connection")
        Set rs = Server.CreateObject("ADODB.Recordset")
        cn.Open "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=YourDataSource;"
        ' rs.CursorLocation = adUseClient ' Uncomment this line to cause this code to work properly.
        rs.Open "SELECT * FROM MYACCT", cn, adOpenKeyset, adLockOptimistic 
        rs("ACCT_NUM")=333
        rs("CUST_NUM")=333
        rs("ACCT_NAME")="barry white"
        rs.Update 
    
    %>
    
    </BODY>
    </HTML>
                        
  3. Save the page in a folder that is part of a Web application in Internet Information Server (IIS).
  4. Browse to the page using Internet Explorer.


Keywords: kbdatabase kbprb KB255707