Hi,
I am trying to rename a column/field in an Access Database Table from within an ASP.NET page. I am aware that it would be much simpler to rename the column/field from within Access itself but the database is in use and to download it would cause unneccessary down time for what I think should be possible in code. (I am aware of the problems with renaming columns on tables that are in use, that is not a problem as this is a table that is not yet in use.)
I have come accross these bits of SQL / Access code:
Code:
ALTER TABLE tableName RENAME COLUMN oldColumnName TO newColumnName
and
Code:
Tabledefs('tableName').Fields('oldCoumnName').Name = 'newColumnName'
These may work in some way but from within my ASP.NET page I am unable to actually modify the table. I have been trying to use myCommand.ExecuteNonQuery() with the above code but I could not get this to work. I also tried using the above code as part of an OLEDB Update Command but have been unsuccessful.
I would appreciate any help that anyone can provide in pointing me in the right direction.
Thanks
--------------------
:) James Sellwood :)
--------------------