Microsoft KB Archive/254517: Difference between revisions

From BetaArchive Wiki
m (Text replacement - ">" to ">")
m (Text replacement - """ to """)
 
Line 12: Line 12:
<div id="TitleRow">
<div id="TitleRow">


= <span id="KB254517"></span>PRB: 800a0bb9 Error: &quot;Application Is Using Arguments That Are of the Wrong Type&quot; =
= <span id="KB254517"></span>PRB: 800a0bb9 Error: "Application Is Using Arguments That Are of the Wrong Type" =




Line 71: Line 71:
This problem is often caused by the code using ADO constants that have not been defined for the page. For example:
This problem is often caused by the code using ADO constants that have not been defined for the page. For example:
<pre class="codesample"><%
<pre class="codesample"><%
set cn=server.CreateObject(&quot;ADODB.Connection&quot;)
set cn=server.CreateObject("ADODB.Connection")
CN.Open &quot;DSN=Gallery&quot;
CN.Open "DSN=Gallery"
set rs=Server.CreateObject(&quot;ADODB.Recordset&quot;)
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open &quot;Select * From Customers&quot;, CN, adOpenStatic, adLockOptimistic
rs.Open "Select * From Customers", CN, adOpenStatic, adLockOptimistic
%>
%>
                 </pre>
                 </pre>
Line 88: Line 88:
<li><p>Use the actual constant values:</p>
<li><p>Use the actual constant values:</p>
<pre class="codesample"><%
<pre class="codesample"><%
set cn=server.CreateObject(&quot;ADODB.Connection&quot;)
set cn=server.CreateObject("ADODB.Connection")
CN.Open &quot;DSN=Gallery&quot;
CN.Open "DSN=Gallery"
set rs=Server.CreateObject(&quot;ADODB.Recordset&quot;)
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open &quot;Select * From Customers&quot;, CN, 3, 3
rs.Open "Select * From Customers", CN, 3, 3
%>
%>
                     </pre></li>
                     </pre></li>
Line 98: Line 98:
Const adOpenStatic = 3
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adLockOptimistic = 3
set cn=server.CreateObject(&quot;ADODB.Connection&quot;)
set cn=server.CreateObject("ADODB.Connection")
CN.Open &quot;DSN=Gallery&quot;
CN.Open "DSN=Gallery"
set rs=Server.CreateObject(&quot;ADODB.Recordset&quot;)
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open &quot;Select * From Customers&quot;, CN, adOpenStatic, adLockOptimistic
rs.Open "Select * From Customers", CN, adOpenStatic, adLockOptimistic
%>
%>
                     </pre></li>
                     </pre></li>
<li><p>Include the Adovbs.inc file with all the constants. You can copy the Adovbs.inc file to your Web projects directory on the Web server from ''[drive]'':\Program files\Common files\System\ADO.</p>
<li><p>Include the Adovbs.inc file with all the constants. You can copy the Adovbs.inc file to your Web projects directory on the Web server from ''[drive]'':\Program files\Common files\System\ADO.</p>
<pre class="codesample"><!--#include file=&quot;adovbs.inc&quot;-->
<pre class="codesample"><!--#include file="adovbs.inc"-->
<%
<%
set cn=server.CreateObject(&quot;ADODB.Connection&quot;)
set cn=server.CreateObject("ADODB.Connection")
CN.Open &quot;DSN=Gallery&quot;
CN.Open "DSN=Gallery"
set rs=Server.CreateObject(&quot;ADODB.Recordset&quot;)
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open &quot;Select * From Customers&quot;, CN, adOpenStatic, adLockOptimistic
rs.Open "Select * From Customers", CN, adOpenStatic, adLockOptimistic
%>
%>
                     </pre></li>
                     </pre></li>
Line 141: Line 141:
<div class="indent">
<div class="indent">


[[../197323|197323]] HOWTO: Troubleshoot &quot;ADODB.Connection&quot; Error 800a0bb9 from Recordset DTC
[[../197323|197323]] HOWTO: Troubleshoot "ADODB.Connection" Error 800a0bb9 from Recordset DTC





Latest revision as of 13:52, 21 July 2020

Knowledge Base


PRB: 800a0bb9 Error: "Application Is Using Arguments That Are of the Wrong Type"

Article ID: 254517

Article Last Modified on 8/23/2001



APPLIES TO

  • Microsoft ActiveX Data Objects 1.5
  • Microsoft ActiveX Data Objects 2.0
  • Microsoft ActiveX Data Objects 2.01
  • Microsoft ActiveX Data Objects 2.1
  • Microsoft ActiveX Data Objects 2.1 Service Pack 1
  • Microsoft ActiveX Data Objects 2.1 Service Pack 2
  • Microsoft ActiveX Data Objects 2.5
  • Microsoft ActiveX Data Objects 2.6
  • Microsoft ActiveX Data Objects 2.7



This article was previously published under Q254517

SYMPTOMS

When you view an Active Server Pages (ASP) page that makes parameterized calls to ASP objects, the following error message appears:

error '800a0bb9'

The application is using arguments that are of the wrong type, or are out of acceptable range, or are in conflict with one another.

/ProjectName/Page.asp, line X

This is often an ADODB.Recordset error.

CAUSE

This problem is often caused by the code using ADO constants that have not been defined for the page. For example:

<%
set cn=server.CreateObject("ADODB.Connection")
CN.Open "DSN=Gallery"
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From Customers", CN, adOpenStatic, adLockOptimistic
%>
                

ASP does not inherently know the values of ADO constants, and therefore the two constants (in this case adOpenStatic and adLockOptimistic) are empty.

RESOLUTION

There are several different ways that you can work around this problem:

  • Use the actual constant values:

    <%
    set cn=server.CreateObject("ADODB.Connection")
    CN.Open "DSN=Gallery"
    set rs=Server.CreateObject("ADODB.Recordset")
    rs.Open "Select * From Customers", CN, 3, 3
    %>
                        
  • Set the constants:

    <%
    Const adOpenStatic = 3
    Const adLockOptimistic = 3
    set cn=server.CreateObject("ADODB.Connection")
    CN.Open "DSN=Gallery"
    set rs=Server.CreateObject("ADODB.Recordset")
    rs.Open "Select * From Customers", CN, adOpenStatic, adLockOptimistic
    %>
                        
  • Include the Adovbs.inc file with all the constants. You can copy the Adovbs.inc file to your Web projects directory on the Web server from [drive]:\Program files\Common files\System\ADO.

    <!--#include file="adovbs.inc"-->
    <%
    set cn=server.CreateObject("ADODB.Connection")
    CN.Open "DSN=Gallery"
    set rs=Server.CreateObject("ADODB.Recordset")
    rs.Open "Select * From Customers", CN, adOpenStatic, adLockOptimistic
    %>
                        
  • If the page is part of a project that was written in Microsoft Visual InterDev, you can set a reference to the ADO type libraries in the project by following these steps:
    1. Open the project in Visual InterDev.
    2. From the Project menu in Visual InterDev, choose Project References.
    3. In the References dialog box, select Microsoft ActiveX Data Objects Library and click OK.


REFERENCES

For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:

190743 PRB: ADODB.Recordset Error '800a0bb9' When Using Boolean Filter


235892 PRB: 800a0bb9 Error Message When Applying a Filter to an ADO Recordset


197323 HOWTO: Troubleshoot "ADODB.Connection" Error 800a0bb9 from Recordset DTC



Additional query words: error 800a0bb9

Keywords: kbexcel123quattro kbprb KB254517