If a table was created with a password, every time that table is opened, we need to specify the correct password for the open table operation to succeed. After the table object is created, but before the table is opened, the table password property must be set.
// opening a table with password
CTTable ATable = new CTTable(ADatabase);
// set the table password
ATable.SetPassword("MyPassword");
// open the table
try
{
ATable.Open("MyTable", OPEN_MODE.NORMAL_OPEN);
}
catch (CTException err)
{
Console.Write("Open table failed with error {0}\n", err.GetErrorCode());
}