I want to change my database path programmatically. I have a folder with several tables, and my users should be able to change from one database to another. For example: active db: D:\app_db\db1 could change to D:\app_db\db2
void change_db(std::string dir)
{
char c[MAX_PATH]={0};
TStringList *list= new TStringList();
list->Clear();
sprintf(c,"PATH=%s",dir.c_str());
list->Add(c);
Session->ModifyAlias(dbalias,list);
delete list;
Table1->DatabaseName = dbalias;
}
When I run the routine above the tables still contain the old path!
Table1->Database->Directory = c;
I set the Directory to new Directory, but my application still uses the old tables.
What is wrong here?
Thanks