database/ | |
License | Copyright © 2007-2011, FreeBASIC Extended Library Development Group |
ext. | |
Statement | Represents a prepared statement and allows access to the results of a statement passed to the database. |
Functions | |
bind | Attaches a value to anonymous parameters in the Query string. |
execute | Executes the prepared statement on the database and steps through the resulting rows (if any). |
numColumns | Returns the number of columns in the result set. |
columnName | |
columnValue | |
finalize | Releases memory held by the statement. |
handle | Database dependant handle to this prepared statement. |
Connection | Represents a connection to a database and provides a facility for prepared statements. |
Functions | |
Component Constructor | Initializes a connection to a database using a connection string and a ext.database.DatabaseDriver. |
Component Constructor | Initializes a database connection with only a ext.database.DatabaseDriver. |
Copy Constructor | Copies the ext.database.DatabaseDriver and connect string from another Connection |
connect | Connects to the database using the passed connection string or the connection string passed to the constructor. |
prepare | Factory method to create Statements |
query | Execute a no results one-off statement. |
close | Closes the connection to the database. |
getError | Returns a string containing the current error message from the database. |
handle | Returns a pointer to the database dependant handle for this connection. |
Copyright © 2007-2011, FreeBASIC Extended Library Development Group
Distributed under the FreeBASIC Extended Library Group license. See accompanying file LICENSE.txt or copy at http://code.google.com
Represents a prepared statement and allows access to the results of a statement passed to the database. This class is not meant to be created manually, only returned from the Connection.prepare function.
Functions | |
bind | Attaches a value to anonymous parameters in the Query string. |
execute | Executes the prepared statement on the database and steps through the resulting rows (if any). |
numColumns | Returns the number of columns in the result set. |
columnName | |
columnValue | |
finalize | Releases memory held by the statement. |
handle | Database dependant handle to this prepared statement. |
declare function bind overload ( byval coli as integer, byval value as integer ) as StatusCode
Attaches a value to anonymous parameters in the Query string.
Supported types are integer, double, string and blob (pointer)
Anonymous parameters in a query string are the ? symbol. Example: INSERT INTO ‘db’ (?,?,?) WHERE ‘username’ = ? Has 4 anonymous parameters numbered 1 to 4.
Represents a connection to a database and provides a facility for prepared statements.
Functions | |
Component Constructor | Initializes a connection to a database using a connection string and a ext.database.DatabaseDriver. |
Component Constructor | Initializes a database connection with only a ext.database.DatabaseDriver. |
Copy Constructor | Copies the ext.database.DatabaseDriver and connect string from another Connection |
connect | Connects to the database using the passed connection string or the connection string passed to the constructor. |
prepare | Factory method to create Statements |
query | Execute a no results one-off statement. |
close | Closes the connection to the database. |
getError | Returns a string containing the current error message from the database. |
handle | Returns a pointer to the database dependant handle for this connection. |
Initializes a connection to a database using a connection string and a ext.database.DatabaseDriver.
connectst | a database dependant connection string. |
d | a pointer to a ext.database.DatabaseDriver |
Initializes a database connection with only a ext.database.DatabaseDriver. You must pass a connection string to the connect function.
d | a pointer to a ext.database.DatabaseDriver |
Copies the ext.database.DatabaseDriver and connect string from another Connection
declare function connect( byref connectst as string = "" ) as StatusCode
Connects to the database using the passed connection string or the connection string passed to the constructor.
connectst | optional (if passed to constructor) database dependant connection string |
Database dependant error code.
Attaches a value to anonymous parameters in the Query string.
declare function bind overload ( byval coli as integer, byval value as integer ) as StatusCode
Executes the prepared statement on the database and steps through the resulting rows (if any).
declare function execute( ) as StatusCode
Returns the number of columns in the result set.
declare function numColumns( ) as integer
declare function columnName( byval iCol as integer ) as string
declare function columnValue( byval iCol as integer ) as string
Releases memory held by the statement.
declare function finalize( ) as StatusCode
Database dependant handle to this prepared statement.
declare function handle() as any ptr
A group of function pointers to enable access to a database.
type DatabaseDriver
Connects to the database using the passed connection string or the connection string passed to the constructor.
declare function connect( byref connectst as string = "" ) as StatusCode
Factory method to create Statements
declare function prepare( byref sql as string ) as Statement ptr
Execute a no results one-off statement.
declare function query( byref sql as const string ) as StatusCode
Closes the connection to the database.
declare function close() as StatusCode
Returns a string containing the current error message from the database.
declare function getError () as string
Returns a pointer to the database dependant handle for this connection.
declare function handle() as any ptr