Changing Field Properties via ADO 3.6 
Author Message
 Changing Field Properties via ADO 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:13:58 GMT  
 Changing Field Properties via ADO 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


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:11:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Changing Field Properties via DAO 3.6

2. Changing Field Properties via DAO 3.6

3. Change a field property via VBA??

4. Change field's Size property via code

5. Field Description property via ADO

6. Property problems with DAO 3.6

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

8. DAO 3.6 changes from 3.5

9. Change DAO3.5/3.6 reference while runtime?

10. Null behavior change from ODBC 3.0 to 3.6

11. Re Data Control with ADO msjet 3.6 Libaray

12. ADO and DAO 3.6

 

 
Powered by phpBB® Forum Software