Build time requirement.
To embed the server or client into your projects you need to link to ‘SQLiteQueryAS.dll’, and get the interfaces to the desired functionality. To help you with that and link to it dynamically you can use <LoadPlugin.h>. The interface declarations are in <ISQLQueryAS.h>.
During the run-time the security database has to exist, If the database is missing the client will not be able to open any databases. See below for the security database details.
Security DB helper interface.
There is a helper interface that helps you deal with the security database. Also included in this page is an example which demonstrates the majority of the functions the interface has. examples
The server requires one file to exist in order to control user access rights. That is, it requires the "security database" which you set the path to using the following interface.
The security database has to contain one table called db_list. This table contains the list of databases which the server can access. If the client requests a database that is not on this list, the client is denied access.
CREATE TABLE db_list (
id INTEGER PRIMARY KEY AUTOINCREMENT
db_name TEXT NOT NULL
db_path TEXT NOT NULL,
db_users_table VARCHAR( 100 )
The db_name field contains the name of the database. This field has to match to the filename of the database without the .db extension.
The db_path field contains the path to the folder containing the database.
The db_users_table field contains the table name which contains the users which have access to the database.
db_name = 'myDatabase'
db_path = 'C:\databases\'
db_users_table = 'tbl_1'
The above will be translated by the server into:
and tbl_1 will be checked for the username, password and access flags.
The users table has the following format.
CREATE TABLE tbl_1 (
id INTEGER PRIMARY KEY
username VARCHAR( 100 ) NOT NULL
password VARCHAR( 100 ) NOT NULL,
It is important to mention that tbl_1 can be any name. But that name has to match db_list.db_users_table field.
The username field contains the username case sensitive.
The password field contains the password case sensitive.
The permission field contains the access rights the user has to the database.
The permission field is or'ed with the below values.
typedef struct _tag_security_permission
static const DWORD GRANT_CREATE_TBALE = 0x00000001;
static const DWORD GRANT_CREATE_VIEW = 0x00000002;
static const DWORD GRANT_CREATE_TRIGGER = 0x00000004;
static const DWORD GRANT_CREATE_ALL =
static const DWORD GRANT_DROP_TABLE = 0x00000008;
static const DWORD GRANT_DROP_VIEW = 0x00000010;
static const DWORD GRANT_DROP_TRIGGER = 0x00000020;
static const DWORD GRANT_DROP_ALL =
static const DWORD GRANT_OP_SELECT = 0x00000040;
static const DWORD GRANT_OP_INSERT = 0x00000080;
static const DWORD GRANT_OP_UPDATE = 0x00000100;
static const DWORD GRANT_OP_DELETE = 0x00000200;
static const DWORD GRANT_OP_ALTER = 0x00000400;
static const DWORD GRANT_OP_ALL =
static const DWORD GRANT_PRAGMAS = 0x00000800;
static const DWORD GRANT_CREATE_DB = 0x00001000;
static const DWORD GRANT_DROP_DB = 0x00002000;
static const DWORD GRANT_EVERYTHING =
GRANT_EVERYTHING = 16383 or 0x00003FFF