DAO - TableDefs

accessman2

Registered User.
Local time
Yesterday, 18:19
Joined
Sep 15, 2005
Messages
335
Hi:

I know that "ALTER Table [Table Name] ALTER Column col1 TEXT" can change datatype.

But, can DAO - TableDefs to change datatype of the fields?
i=0
Do While i <= tbl.Fields.count - 1
If (tbl.Fields(i).Name = "Codes") Then
tbl.Fields(i).Properties("DataType").Type = dbText
End If
i = i+1
Loop

Please let me know, thanks.
 
I think you'd be better off using ADOX (google it). Or straight DDL.

So, what happened when you tried?
 
Last edited:
No.

(Some more text because "no" is too short. Umm - "To answer your direct question - No" :-)
 
Conversely though DDL statements can't change the name of a field - whereas DAO can.
Horses for courses. :-)
 

Users who are viewing this thread

Back
Top Bottom