PRB: Error 3251 Generated by Calling ADOX Methods (201716)



The information in this article applies to:

  • ActiveX Data Objects (ADO) 2.1
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0

This article was previously published under Q201716

SYMPTOMS

Executing an ADOX method such as the following:
Catalog.Tables.Append tbl
				
against SQL Server may generate the following error:
Run time error "3251": "The operation requested by the application is not supported by the provider".

CAUSE

SQL Server's Stored Procedures are not current.

RESOLUTION

Run the Instcat.sql script that came with the version of Microsoft Data Access Components (MDAC) currently installed.

STATUS

This behavior is by design.

MORE INFORMATION

The Connection's Errors collection should also reveal an error like the following:
[Microsoft][ODBC SQL Server Driver][SQL Server]The ODBC catalog stored procedures installed on server (local) are version 6.50.193; version 07.00.0523 or later is required to ensure proper operation. Please contact your system administrator.
The catalog stored procedures installed on server <Server_Name> are version 6.50.193; version 07.00.0330 or later is required to support IDBSchemaRowset. Please contact your system administrator.

Steps to Reproduce Behavior

  1. Start Visual Basic.
  2. Choose a Standard EXE Project Type.
  3. Add the following References to the Project:
       Microsoft ActiveX Data Objects
       Microsoft ADO Ext. for DDL and Security
    					
  4. Paste the following code in the Load method of the default Form:
    Dim tbl As New ADOX.Table
    Dim cn As New ADODB.Connection
    Dim cl As New ADOX.Column
    Dim cat As New ADOX.Catalog
    
    'Open Connection to Data Source
    With cn
        .ConnectionString = "PROVIDER=sqloledb;DATA SOURCE=<your_server;USER ID=<uid>;PASSWORD=<pwd>;INITIAL CATALOG=pubs"
        .Open
    End With
    
    'Associate the Catalog object to the Connection.
    With cat
        .ActiveConnection = cn
    End With
    
    'Create a table definition.
    With tbl
        .Name = "MyADOXtbl"
    End With
    
    'Create a Column definition.
    With cl
        .Name = "Col1"
        .DefinedSize = 10
        .Type = adChar
        .Attributes = adColFixed + adColNullable
    End With
    
    'Add the Column definition to the table table definition.
    tbl.Columns.Append cl
    
    'Create the table on the Data Source
    cat.Tables.Append tbl
    					

Modification Type:MajorLast Reviewed:8/23/2001
Keywords:kbDatabase kbDSupport kbprb KB201716