LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I rename an access97 table with Labwindows CVI Sql toolkit

Because I could not find out how to add columns to a table, I created a new table with the extra columns I needed and copied the records from the old table into the newly created table. I then droped the old table and now need to know how to remane the newly created table to the same name the old table had.
0 Kudos
Message 1 of 2
(2,981 Views)
You will need to look at the SQL language reference for Access 97/Microsoft Jet database engine to see if it has an SQL statement that you can use to do this. There isn't a specific function you call with the SQL Toolkit that allows you to do any of the things that you mentioned, but rather you need to use the DBImmediateSQL or DBActivateSQL functions to execute an SQL statement that causes the database driver to add columns or rename the table. After looking through the Help in Microsoft Access 2000, I saw that there is an ALTER TABLE SQL statement that you can actually use to add columns to a table and the example they gave is like this:

"ALTER TABLE Employees ADD COLUMN Notes TEXT(25)"

So in light of this information it might be possible for you to figure out
how to rename the table as well. The help didn't expressly say that you would use the ALTER TABLE statement to rename the table but I think that that might be the proper one to use, or else it may be capable of doing a RENAME TABLE like you can with Fox Pro.

To find more information than you have in the online help in Microsoft Access you might also check out http://msdn.microsoft.com to find more development information.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 2
(2,981 Views)