DAO - TableDefs (1 Viewer)

accessman2

Registered User.
Local time
Today, 11:51
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.
 
Local time
Today, 13:51
Joined
Mar 4, 2008
Messages
3,856
I think you'd be better off using ADOX (google it). Or straight DDL.

So, what happened when you tried?
 
Last edited:

LPurvis

AWF VIP
Local time
Today, 19:51
Joined
Jun 16, 2008
Messages
1,269
No.

(Some more text because "no" is too short. Umm - "To answer your direct question - No" :)
 

LPurvis

AWF VIP
Local time
Today, 19:51
Joined
Jun 16, 2008
Messages
1,269
Conversely though DDL statements can't change the name of a field - whereas DAO can.
Horses for courses. :)
 

Users who are viewing this thread

Top Bottom