|
-
August 10th, 2001, 11:03 AM
#1
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.
-
August 10th, 2001, 11:38 AM
#2
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]
-
August 10th, 2001, 01:22 PM
#3
Didn't work
Sorry, I've looked at these methods before, but still haven't found out how to set whether the value of a field is "Required".
To see the properties I want to set, Open a table in Access in Design mode. Down at the bottom is a list of properties. So far, it seems they can't be changed with VB and ADO.
PLEASE, someone tell me how to access these properties.
Thanks again,
Tony
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|