I am currently writing a Visual Basic application that uses Microsoft Access 1.1. I faced a big problem to rename a fields-in-access table with Visual Basic. Is there any way to rename a field (field name) with Visual Basic language? Since I have a batch of database files (around 700), I want the process to be automated.
Eddie Cheung
No problem, Eddie. First you must create a new table with the new names, then copy the table. The structured query language for it would be:
Dim DB As database
Set DB = OpenDatabase("C:\MyData.mdb")
DB.Execute "SELECT DISTINCTROW Authors.Author AS [New Author] INTO [New Author]
FROM Authors;"
After copying the table, you can delete the original version and rename the new one with the original name.