Creating ADOX tables

David Thorpe

New member
Local time
Today, 16:01
Joined
Apr 11, 2003
Messages
6
Can anybody advise me how to specify field parameters when creating ADOX tables? For instance, ".Columns.Append "ITEM", adWChar 16" generates a 16 character field - but how do I set the "Required" property to Yes, or specify a validation rule?

I have tried to adapt a DAO method, but failed miserably!
 
have you tried using the Properties of the Column Object.

Example:

cat.Tables("Customers").Columns("CustomerID").Properties("Primary Key").Value = True
 
David,

The following are the ADOX Properties of a field (Column)
Index Name
------- --------
0 Autoincrement
1 Default
2 Description
3 Nullable
4 Fixed Length
5 Seed
6 Increment
7 Jet OLEDB:Column Validation Text
8 Jet OLEDB:Column Validation Rule
9 Jet OLEDB:IISAM Not Last Column
10 Jet OLEDB:AutoGenerate
11 Jet OLEDB:One BLOB per Page
12 Jet OLEDB:Compressed UNICODE Strings
13 Jet OLEDB:Allow Zero Length
14 Jet OLEDB:Hyperlink


When ever you don't know all of the properties you can always create a loop to get them.

Example
Code:
        'Properties are zero based so you have to remove one from the count or you will get an out of range error.
        For x = 0 To .Columns("ID").Properties.Count - 1
            Debug.Print x & ": " & .Columns("ID").Properties(x).Name
        Next x
 

Users who are viewing this thread

Back
Top Bottom