Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename Column

Status
Not open for further replies.

jalbao

Programmer
Nov 27, 2000
413
US
I am using an Access 2000 database and I'm trying to figure out how (if possible) to rename a field using a SQL statement. From what I can tell, the SQL92 "Rename Column" function is not supported in Access 2000. Any tips/work-arounds etc?

tia
 
Add a new column; copy old value to new; drop old column.


sql = "ALTER TABLE MyTable ADD NewName VARCHAR(50)"
CurrentDb.Execute strSQL, dbFailOnError

sql = "UPDATE MyTable SET NewName = OldName"
CurrentDb.Execute strSQL, dbFailOnError

sql = "ALTER TABLE MyTable DROP OldName"
CurrentDb.Execute strSQL, dbFailOnError
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top