
Changing Field Properties via DAO 3.6
I forgot to mention, this is code I'm using:
Dim DBase As Database
Dim TblDef As TableDef
Dim objField As Field
Set DBase = OpenDatabase("C:\Windows\Desktop\Patients.mdb")
Set TblDef = DBase.TableDefs("Patients")
Set objField = TblDef.CreateField("txtAddress", dbText, 50)
objField.CompressUnicode = True
TblDef.Fields.Append objField
When I run this code it I get the error "Method or Data member not found".
This error is referring to "CompressUnicode". If I comment out the
"objField.CompressUnicode.." line, I get the following error, "Type
Mismatch". This error is pointing at the line "Set objField =
TblDef.CreateField...."
I have a database whose fields accept "Null" values and whose fields can be
empty. I apended the "txtAddress" field above mentioned via ADOX, and it
worked fine, but as I found out, I could not change the properties via ADOX.
So I decided to use ADO instead, but now I'm at this point stuck once again.
Thanks again for any help
Fausto Lopez
Quote:
> How do I change the "Nullable" property to "False" and the "Compress
> UNICODE" to "True" via DAO 3.6 on an Access 2000 database?
> Fausto Lopez