|Home||How To||Online Documentation||Support||Download||Order|
Connecting to databases
To connect to a database you should create a connection object and then connect it.
For example, let's connect to SQL Server database Demo as user Guest with a password May and then disconnect from it.
Step 1. Creating a connection object.
A connection object is represented by SAConnection class.
The line above creates a connection object con.
con.setClient( SA_SQLServer_Client );
Step 2. Connecting to a database.
After the connection is created we need to connect it using SAConnection::Connect method.
con.Connect( "Demo", "Guest", "May", SA_SQLServer_Client );
con.Connect( "Demo", "Guest", "May" );
Step 3. Disconnecting from a database.
You can disconnect your connection object at any time with a call to the SAConnection::Disconnect method:
It is safe to skip calling SAConnection::Disconnect method explicitly. Destructor SAConnection::~SAConnection will correctly close the connection if you didn't call SAConnection::Disconnect method before.
Problems and Questions
If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to email@example.com.