FIX: Error When You Append a Table Object to a Catalog Object If the Object Variables Are Late-Bound (235390)



The information in this article applies to:

  • ActiveX Data Objects (ADO) 2.1
  • ActiveX Data Objects (ADO) 2.1 SP1
  • ActiveX Data Objects (ADO) 2.1 SP2

This article was previously published under Q235390

SYMPTOMS

If you create a late-bound ADOX Catalog object and use it to append a Table object to the Catalog, you may receive the following error message:
Runtime error '3001':
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.

CAUSE

You can only use early-bound ADOX objects to append Table objects to the Catalog.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in ActiveX Data Objects (ADO), version 2.5 or later. You can download the latest version of ADO from the following Microsoft Web site:

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new Standard EXE project in Visual Basic. Form1 is created by default.
  2. Place a CommandButton control onto Form1.
  3. Paste the following code in the form module of Form1:
    Option Explicit
    
    Private Sub Command1_Click()
        Dim ct As Variant
        Dim tbl As Variant
        Set ct = CreateObject("ADOX.Catalog")
        Set tbl = CreateObject("ADOX.Table")
        ct.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Nwind.mdb"
        tbl.Name = "table1"
        tbl.Columns.Append "Column1"
        ct.Tables.Append tbl
    End Sub
    					
  4. Modify the code so that the ct.ActiveConnection property assignment points to a valid database.
  5. Run the code. Try to append the Table to the Catalog, and you receive the above-mentioned error message.

Modification Type:MinorLast Reviewed:4/22/2003
Keywords:kbBug kbfix kbMDACNoSweep KB235390