I am using ADOX (on Windows 2000) to create a new table in my database.
One of the columns must have a default for each new record so I wish to
populate the default dynamic property.
However, I cannot do this because when I try to set the value of the
default property I am told the data type is wrong (it is expecting
adVariant) - I have tried casting it using CVar etc.
Please can anyone help. Code follows.....
Set adoxCatalog.ActiveConnection = ADOCon
Set adoxTable = New adox.Table
adoxTable.Name = "MyNewTable"
Set adoxCol = New adox.Column
Set adoxCol.ParentCatalog = adoxCatalog
adoxCol.Name = "MyNewColumn"
adoxCol.Type = adInteger
adoxCol.Attributes = adColFixed
adoxCol.Properties("Default").Value = 0 ' this line fails
adoxTable.Columns.Append adoxCol