Microsoft KB Archive/254517

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 13:52, 21 July 2020 by X010 (talk | contribs) (Text replacement - """ to """)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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