Board index » cppbuilder » Adding a Column to a Access db

Adding a Column to a Access db


2004-06-17 02:45:11 AM
cppbuilder36
Hi,
I am currently using BCB5 Pro, and Win 98 SE.
I have a MS Access Database that may require additional columns.
Have tried:
char sql_command[255] ;
UpdateSQL->ModifySQL->Clear();
strcpy(sql_command,
"ALTER TABLE table_name ADD COLUMN new_col Number
AFTER col_1");
UpdateSQL->ModifySQL->Add(sql_command);
UpdateSQL->Apply(ukModify);
This creates the new column put also returns a failure error.
Is there also a way to verify column exists without returning an error?
Thanks in Advance
Andrew
 
 

Re:Adding a Column to a Access db

Look columns schema - TADOConnection::OpenSchema(siColumns).
"Andrew McIsaac" < XXXX@XXXXX.COM >сообщи?сообщила ?новостях
следующе? news: XXXX@XXXXX.COM ...
Quote

Hi,
I am currently using BCB5 Pro, and Win 98 SE.
I have a MS Access Database that may require additional columns.
Have tried:

char sql_command[255] ;

UpdateSQL->ModifySQL->Clear();
strcpy(sql_command,
"ALTER TABLE table_name ADD COLUMN new_col Number
AFTER col_1");
UpdateSQL->ModifySQL->Add(sql_command);
UpdateSQL->Apply(ukModify);

This creates the new column put also returns a failure error.
Is there also a way to verify column exists without returning an error?

Thanks in Advance
Andrew