Using ADOX to modify SQLServer 2000 tables

Using ADOX to modify SQLServer 2000 tables

Post by Oliver Seama » Sat, 11 Nov 2000 04:00:00



I'm trying to create tables using ADOX, and specifically to add new
columns to existing tables.

I have very basic code for doing this which works fine if I use it to
connect to Access, but if I use it to connect to SQLServer then when I
create a table I get the following error message displayed:

        "Run-time error '3251': Object or provider is not capable of
performing requested operation"

This error is documented in the knowledge base as being due to not
having an up to date INSTCAT.SQL file installed into SQLServer, ie a
version less that 7, however I've checked and my freshly installed
SQLServer 2000 is using version 8.00.128.

I've tried installing the INSTCAT.SQL from MDAC 2.6, and I've tried
against a new SQLServer 2000 installation. Always the same error
appears. The knowledge base article says that the connection's Errors
collection should have further information, which it doesn't, so I
suspect the problem is not related to INSTCAT.SQL

What I'm trying to do is very basic, and yet I'm falling at the first
hurdle - does anyone have a clue what might be going wrong?

Here's the code I'm using, very simple:

   Dim tbl As New ADOX.Table
   Dim cat As New ADOX.Catalog
   cat.ActiveConnection = "driver=SQL
Server;server=myserver;database=mydatabase"
   tbl.Name = "mytable"
   tbl.Columns.Append "ID", adInteger
   ' The following line gives the error
   cat.Tables.Append tbl

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Using ADOX to modify SQLServer 2000 tables

Post by mary chipma » Sun, 12 Nov 2000 04:00:00


ADOX was designed for Jet, not SQL Server. some things work, some
things don't. why don't you learn T-SQL and just execute CREATE
TABLE/ALTER TABLE statements from ADO? guaranteed to work with no fuss
and fully documented in SQL BOL.

On Fri, 10 Nov 2000 17:26:49 GMT, Oliver Seaman


>I'm trying to create tables using ADOX, and specifically to add new
>columns to existing tables.

>I have very basic code for doing this which works fine if I use it to
>connect to Access, but if I use it to connect to SQLServer then when I
>create a table I get the following error message displayed:

>    "Run-time error '3251': Object or provider is not capable of
>performing requested operation"

>This error is documented in the knowledge base as being due to not
>having an up to date INSTCAT.SQL file installed into SQLServer, ie a
>version less that 7, however I've checked and my freshly installed
>SQLServer 2000 is using version 8.00.128.

>I've tried installing the INSTCAT.SQL from MDAC 2.6, and I've tried
>against a new SQLServer 2000 installation. Always the same error
>appears. The knowledge base article says that the connection's Errors
>collection should have further information, which it doesn't, so I
>suspect the problem is not related to INSTCAT.SQL

>What I'm trying to do is very basic, and yet I'm falling at the first
>hurdle - does anyone have a clue what might be going wrong?

>Here's the code I'm using, very simple:

>   Dim tbl As New ADOX.Table
>   Dim cat As New ADOX.Catalog
>   cat.ActiveConnection = "driver=SQL
>Server;server=myserver;database=mydatabase"
>   tbl.Name = "mytable"
>   tbl.Columns.Append "ID", adInteger
>   ' The following line gives the error
>   cat.Tables.Append tbl

>Sent via Deja.com http://www.deja.com/
>Before you buy.


 
 
 

1. Using ADOX to modify SQLServer 2000 tables

I'm trying to create tables using ADOX, and specifically to add new
columns to existing tables.

I have very basic code for doing this which works fine if I use it to
connect to Access, but if I use it to connect to SQLServer then when I
create a table I get the following error message displayed:

        "Run-time error '3251': Object or provider is not capable of
performing requested operation"

This error is documented in the knowledge base as being due to not
having an up to date INSTCAT.SQL file installed into SQLServer, ie a
version less that 7, however I've checked and my freshly installed
SQLServer 2000 is using version 8.00.128.

I've tried installing the INSTCAT.SQL from MDAC 2.6, and I've tried
against a new SQLServer 2000 installation. Always the same error
appears. The knowledge base article says that the connection's Errors
collection should have further information, which it doesn't, so I
suspect the problem is not related to INSTCAT.SQL

What I'm trying to do is very basic, and yet I'm falling at the first
hurdle - does anyone have a clue what might be going wrong?

Here's the code I'm using, very simple:

   Dim tbl As New ADOX.Table
   Dim cat As New ADOX.Catalog
   cat.ActiveConnection = "driver=SQL
Server;server=myserver;database=mydatabase"
   tbl.Name = "mytable"
   tbl.Columns.Append "ID", adInteger
   ' The following line gives the error
   cat.Tables.Append tbl

Sent via Deja.com http://www.deja.com/
Before you buy.

2. SQL statement to compare substrings?

3. Using ADOX Catlog to modify properties of existing table

4. Speed problems in large LANs

5. Vinculate Tables in Access 2000 using ADOX

6. Configuration DB2 help me

7. Modify Access 2000 table structure using ADO in VB6

8. Largest Oracle Installation in the WORLD!!!

9. SQLServer Linked table in Access 2000 using BIGINT data types

10. Modifying the column Properties using ADOX

11. How to modify column position in existing table with ADOX

12. using ADOX to migrate from Access to SQLServer

13. Views Created Using ADOX Are Not Visible in Access 2000