Database pathThe database path, by default, is the server directory for client/server applications, or the application directory for non-server applications. To set a different database path, when the database is being created, just insert the appropriate path as the second parameter of CTSession::CreateDatabase(). With this information stored in the Session dictionary, the user does not need to know where it is located, since it will be automatically retrieved given the database name. Once the database is successfully connected to a session, obtain the database path with CTDatabase::GetPath(). // display database properties void DisplayDatabaseProperties(CTDatabase &ADatabase) {
printf(“Database: %s\n”, ADatabase.GetName().c_str()); printf(“Path: %s\n”, ADatabase.GetPath().c_str()); printf(“Number of tables: %d\n”, ADatabase.GetTableCount()); } |
|||