Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADOX changing field
Message
From
01/05/2002 10:23:12
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00651135
Message ID:
00651303
Views:
14
This message has been marked as the solution to the initial question of the thread.
>I try to figure out how to update a table in a Access database with some changes in field length. I found that I can use table.columns.refresh() when it comes to adding or deleting fields, but what is the most convenient way to change such things as a field length?

Field (column) properties are read-only in ADOX, you would have to create a new table with the desired structure, transfer the data and drop the old table.

A simpler way of doing it is with SQL:
oCn = CreateObject("ADODB.Connection")

oCn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Temp\db1.mdb;")
oCn.Execute("ALTER TABLE [myTable] ALTER COLUMN [Column3] text(20);",,128)
HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform