First we need to open a connection to a database by providing the FairCom Database Engine with a user name, password and the database name.
Below is the code for Initialize():
//---------------------------------------------------------------------------
void TForm1::Init()
{
try
{
// Initialize the session
CtSession1->AutoCreate = true;
CtSession1->Active = true;
// Initialize the database
CtDatabase1->Session = CtSession1;
CtDatabase1->AutoCreate = true;
CtDatabase1->Database = "tutorial";
CtDatabase1->Active = true;
// Initialize the table
TabCustMast->Database = CtDatabase1;
}
catch (ECtError &E)
{
Application->ShowException(&E);
}
}