I am creating a new table in SQLServer 7.0 using ADOX 2.1 from VB6. When i
try to create a column of type adTinyInt, the program causes the following
error in the Catalog.Tables.Append method:
Run-time error '-2147217859 (80040e3d)': a specified type was invalid
It all works fine if i create a column with (for instance) the adInteger
type instead.
Here is the code:
-------
Private Sub Command1_Click()
Dim CnTo As New ADODB.Connection
Dim XCatalog As New ADOX.Catalog
Dim XTable As New ADOX.Table
Dim XColumn As New ADOX.Column
CnTo.Open "Provider=SQLOLEDB;User Id=sa;Initial Catalog=test1"
'Reference to the catalog
Set XCatalog.ActiveConnection = CnTo
'Create New Table
XTable.Name = "NewTable"
'Create New column
XTable.Columns.Append "NewColumn", adTinyInt
'Now Append the table (this gives the error)
XCatalog.Tables.Append XTable
End Sub
--------------------
Helps appreciated.
Fabio Pagano