Microsoft KB Archive/235390

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

Article ID: 235390

Article Last Modified on 5/17/2007

-

APPLIES TO


 * Microsoft ActiveX Data Objects 2.1
 * Microsoft ActiveX Data Objects 2.1 Service Pack 1
 * Microsoft ActiveX Data Objects 2.1 Service Pack 2

-



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:

http://msdn2.microsoft.com/en-us/data/aa937695.aspx



Steps to Reproduce Behavior
 Create a new Standard EXE project in Visual Basic. Form1 is created by default. Place a CommandButton control onto Form1.  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  Modify the code so that the ct.ActiveConnection property assignment points to a valid database. Run the code. Try to append the Table to the Catalog, and you receive the above-mentioned error message.</ol>

Additional query words: ADO extensibility latebound earlybound adox 3001

Keywords: kbbug kbfix kbmdacnosweep KB235390

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.