Changing Field Properties via DAO 3.6 
Author Message
 Changing Field Properties via DAO 3.6

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



Thu, 26 Jun 2003 09:11:33 GMT  
 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



Thu, 26 Jun 2003 21:10:08 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Changing Field Properties via DAO 3.6

2. Changing Field Properties via ADO 3.6

3. Property problems with DAO 3.6

4. 3259 - Invalid Field data type with DAO 3.6 in VB

5. DAO 3.6 changes from 3.5

6. Moving from DAO 3.5 to DAO 3.6

7. Convert DAO 3.5 to DAO 3.6 Jet Engine 4.0

8. DAO 3.6 vs DAO 3.5 (VB6.0 sp3)

9. Reference DAO 3.6 Object Library or DAO 2.5/3.51 Compatibility Library

10. Upgrade from DAO 3.5 to DAO 3.6

11. upgrade from DAO 3.51 to DAO 3.6??

12. DAO 3.51 to DAO 3.6 NULLs question

 

 
Powered by phpBB® Forum Software