Setting Field Properties for Access table with ADO.
PLEASE HELP!
I'm having difficulty with setting the properties of fields with ADO for an Access DB. I have created a new table and the appropriate Fields (names and datatypes), but cannot figure out how to set the properties such as: "Required", "Allow Zero Length", "Indexed", etc. that can be set from within access.
How can I dynamically tell what properties are available (different datatypes have different properties) , and then set them accordingly.
ANY help would be much appreciated.
Thanks.
Re: Setting Field Properties for Access table with ADO.
Dim FlatCat As New ADOX.Catalog
FlatCat.ActiveConnection = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\data\mydb.mdb;" 'must use OLEDB.4.0.. not 3.51
Set objNewColumn = New ADOX.Column
objNewColumn.Name = "Additional Information"
objNewColumn.Attributes = adColFixed And Not adColNullable
objNewColumn.Type = adVarWChar
objNewColumn.DefinedSize = 30
objNewTable.Columns.Append objNewColumn
objNewColumn.Properties("Jet OLEDB:Allow Zero Length").Value = True
objNewColumn.Properties("Default").Value = """"""
Iouri Boutchkine
[email protected]