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

Article translations Article translations
Article ID: 254517 - View products that this article applies to.
This article was previously published under Q254517
Expand all | Collapse all

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

Properties

Article ID: 254517 - Last Review: August 23, 2001 - Revision: 1.0
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
Keywords: 
kbexcel123quattro kbprb KB254517
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com