This document shows you how to create a database for Symbian SQL.
Working with databases is not possible until the database exists. In this tutorial you will learn how to create a simple database.
This tutorial uses code from the Basic SQL example application .
The SQL statement used for this tutorial is shown here:
CREATE DATABASE \\Basic_db.db
The database now exists. You can perform all the standard SQL operations on the database including creating and populating a table, querying the database, editing records and deleting the database, to name a few.
The following code snippet is from the example code used for this tutorial:
... _LIT(KDatabaseName, "\\Basic_db.db"); _LIT(KDatabaseMsg,"\nCreating a database\n"); ... CConsoleBase* iConsole; ... void CBasicSqlExample::CreateDatabaseL() { RSqlDatabase db; iConsole->Printf(KDatabaseMsg); //create the database User::LeaveIfError(db.Create(KDatabaseName)); iConsole->Printf(KDatabaseName); CleanupClosePushL(db); ... }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.