
ADOX, Jet OLEDB:Allow Zero Length ERROR...
EUREKA - I HAVE IT!!!!!!!!!
be sure to DIM all objects WITHOUT the "New" keyword.
Dim cat As ADOX.Catalog
Dim db_TableDef As ADOX.Table
Dim db_Field As ADOX.Column
Then:
'Create your database (Catalog)
Set cat = New ADOX.Catalog
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=4;Data
Source=" & DB_DSN$
' Create your table
Set db_TableDef = New ADOX.Table
With db_TableDef
.Name = TableName$
.ParentCatalog = cat <==== THIS IS IMPORTANT
End With
cat.Tables.Append db_TableDef
'Create your field(s)
Set db_Field = New ADOX.Column
'Note - the variables Field_Name$, Field_Type, etc are passed in to my
routine with aappropriate values already set.
With db_Field
.Name = Field_Name$
.Type = Field_Type
.DefinedSize = Field_Size
.ParentCatalog = cat <==== THIS ALSO IS IMPORTANT
.Properties("Nullable").Value = True
.Properties("Jet OLEDB:Allow Zero Length").Value = True
End With
db_TableDef.Columns.Append db_Field
'Close your field (column)
Set db_Field = Nothing
'When you're done with all the field(s) in a table,
'Close your table
Set db_TableDef = Nothing
'When you're done with all the tables in the database,
'Close the database
Set cat = Nothing