Why Choose Us
Single File System
Active Query Builder
How To Buy
Why Choose Us
Products –> VCL
Products –> VCL
Accuracer ODBC Driver
Establishing a connection
Because of SQLBrowseConnect is the part of the Level1 ODBC function conformance but is not supported by most of the leve1 drivers as well as by the current version of Accuracer ODBC Driver, now there are only two ways to establish a connection to a data source:
Using an existing DSN, by calling SQLConnect with ServerName=DSN. In this case the Driver uses connection parameters (for example, the path to a database file for file-server mode or database name, remote host, remote port, local host for client-server mode) from this DSN, so all the parameters must be set in the DSN information.
Using a connection string which contains database path or DSN, by calling SQLDriverConnect. If you specify a correct database path using DATABASE keyword in a connection string (f.e., DATABASE=C:\MyDocuments\My_Database.adb), the Driver will work with this database in file-server mode even in case you also specify DSN which is configured to work in client-server mode. You may set DriverCompletion argument to SQL_DRIVER_NOPROMPT to omit a dialog. Otherwise you must set DriverCompletion flag to SQL_DRIVER_PROMPT, SQL_DRIVER_COMPLETE, or SQL_DRIVER_COMPLETE_REQUIRED. In case of SQL_DRIVER_PROMPT driver shows a dialog form to enable user to enter path to database file. If you specify DSN keyword instead of DATABASE, the Driver shows the dialog form with the database connection parameters from this DSN. In case of SQL_DRIVER_COMPLETE, or SQL_DRIVER_COMPLETE_REQUIRED the driver shows the dialog only if it can not establish a connection to the specified database or if the database is not specify. Dialog will be shown while a user enters the correct path to the database.
The FILEDSN, SAVEFILE keywords in the connection string are not supported, so you can set only User and System DSN using the ODBC Administrator. The UID and PWD keywords are ignored.
SQLColAttributes - in the result set. Fastest.
SQLDescribeCol - in the result set. Fast.
SQLColumns - in databases using the searching masks for databases, for tables, and for columns. Slowest.
SQLColumns and SQLTables work with only connected database now, so it is not important what you specify in DATABASE (CATALOG) parameter.
Executing SQL statement
To execute SQL statement you can call ether SQLExecDirect or SQLPrepare then SQLExecute one or more times.
You can use SQL statement template in SQLExecDirect as well as in SQLPrepare-SQLExecute (like SELECT * FROM Table1 WHERE Field1=? And Field2=?) and bind values by SQLBindParameter.
: SQLPrepare in current release calls SQLExecDirect. It is preparing the information about the result set to allow using such functions as SQLDescribeCol, SQLNumResultCols and others according to ODBC standard immediately after SQLPrepare without calling SQLExecute. This feature enables you to fetch the data after SQLPrepare without calling SQLExecute but it does not conform the ODBC specification.
: The Accuracer ODBC Driver is not tested in multithread environments. Despite the facts that the Accuracer is thread-safe and the Driver based on the Accuracer database engine you should test the Driver if you plan to use it in the multithread environment.
You can retrieve data from a table by one of the following ways:
Call SQLNumResultCol to determine the number of columns in the result set. Scroll the one row cursor by SQLFetch while it returns 0 (SQL_SUCCESS) then call SQLGetData so many times as it is defined by SQLNumResultCol to fetch the data from each column and repeat scrolling and getting until SQLFetch returns 100 (SQL_NO_DATA). Also you can learn the number of rows in the result set by calling SQLRowCount and scroll to any row by calling SQLFetch some times one after another.
Bind a number of buffers for some columns in a result set by SQLBindCol. If you need all the columns or you do not know how many columns are in the result set, call SQLNumResultCol to define the number of columns in the result set before binding all the columns then use SQLDescribeCol to learn the type of data in each column. To retrieve a data call SQLFetch. If the columns were bound SQLFetch puts the data to buffers for all bound columns in a row and scroll the cursor to the next row in the result set.
Using row-wise binding by calling SQLBindCol and fetch multiple rows using block cursors, by calling SQLExtendedFetch
: Bookmarks are not supported by the Driver. SQLDescribeCol, SQLNumResultCols, and SQLRowCount do not support operation on column number 0 to retrieve bookmark metadata because it is a feature 204 in Level 2 Interface Conformance.
: ODBC specification does not enable you to store value with fractional seconds precision in Time field while Accuracer does. If you need fraction of seconds, you should use DateTime field instead of Time field. You must be sure that Time field does not have record(s) with fraction of seconds for correct work of Accuracer ODBC Driver.
: Current version of Accuracer SQL engine and Accuracer ODBC Driver based on it do not allow work with fraction of seconds both in Time and DateTime fields. We plan to release such a capability in one of the closest versions.
: Because of there are no data types of such fields in ODBC specification some Accuracer data types may looks differ via Accuracer ODBC Driver (run Test demo to see). You can find some declarations in the table below:
: Accuracer ODBC Driver is not tested with all advanced data types which Accuracer supports. Some advanced Accuracer data types may not supported by the Accuracer ODBC Driver or may works with some features. Please test advanced types you need before build the project (you can use Test demo and Accuracer Manager to build and test the database with types you need). Please contact
if you need any features.
Management of statement attributes
You have no needs to call SQLFreeStmt with option SQL_CLOSE after executing SELECT statement and fetching the data as it is required in other drivers, Accuracer ODBC Driver closes old statement automatically when you execute a new one. You must release all the column buffers bound by SQLBindCol for the current StatementHandle by calling SQLFreeStmt with SQL_UNBIND parmeter before you bound new columns or fetch new data without columns binding (by SQLFetch - SQLGetData). Calling SQLFreeStmt with option SQL_CLOSE does the same as with SQL_UNBIND option.
The Accuracer ODBC Driver supports most of Core Level functions and some extra features exceeded Core Level interface conformance and v.2 ODBC Specification. The Level 1 interface-conformant features of the Driver let the application do the following, in addition to the features in the Core interface conformance level:
Feature 103: Use scrollable cursors, and thereby achieve access to a result set in methods other than forward-only, by calling SQLFetchScroll with the FetchOrientation argument other than SQL_FETCH_NEXT (exceeding the SQL_FETCH_BOOKMARK FetchOrientation which is a feature 204 in "Level 2 Interface Conformance.")
Multipart name emulation (Feature 101 in Level 1 and Feature 201 in level 2) is released in SQLGetInfo, SQLTables, SQLColumns, SQLPrepare, SQLExecute, SQLExecDirect. They were needed to allow some application to work with driver. We strictly do not recommend use this feature directly from your ODBC application.
The v.3 ODBC specification features:
SQL_DESC_NUM_PREC_RADIX, SQL_DESC_NULLABLE attributes in SQLColAttributes (ODBC v.3 Specification).
The Accuracer ODBC Driver does not allow the following:
Specify a bind offset.
Use the data-at-execution dialog, involving calls to SQLParamData and SQLPutData.
Use bookmarks. SQLDescribeCol, SQLNumResultCols, and SQLRowCount do not support operation on column number 0 to retrieve bookmark metadata because it is a feature 204 in Level 2 Interface Conformance.
Manage cursors. Functions SQLGetCursosName and SQLSetCursorName are not supported by the driver.
Manage data sources and connections by calling SQLDataSources and SQLDisconnect. It can not obtain information on drivers by SQLDrivers function.
Obtain diagnostic information, by calling SQLError.
Also, detect the result of any text substitutions made to an SQL statement before it is sent to the data source, by calling SQLNativeSql.
Use the syntax of SQLEndTran to commit a transaction.
Call SQLCancel to cancel the data-at-execution dialog and, in multithread environments, to cancel an ODBC function executing in another thread. The Driver is not thread-safe. It supports only one connection.
Obtain the SQL_BEST_ROWID row-identifying column of tables, by calling SQLSpecialColumns.
Some functions have peculiarities described below:
SQLGetStmtOption and SQLSetStmtOption support all options. The options below have the following default values and used in:
SQL_ROWSET_SIZE = 1. Used in SQLExtendedFetch.
SQL_BIND_TYPE = SQL_BIND_BY_COLUMN. Switches column-wise and row-wise binding in SQLExtendedFetch.
SQL_USE_BOOKMARKS = SQL_UB_OFF. Bookmarks are not supported so you may get this option but can not change its' value.
SQLGet ConnectOption and SQLSetConnectOption support the options below with the following features:
SQL_ATTR_CURRENT_CATALOG always returns full database file path.
SQL_ATTR_CONNECTION_DEAD is set to SQL_CD_FALSE
SQLStatistics and SQLSpecialColumns always return empty tables as a result set.
The following functions are available but do nothing and return the following RETCODEs:
SQLNumParams - SQL_SUCCESS
SQLParamData - SQL_SUCCESS
SQLPutData - SQL_SUCCESS
SQLGetCursosName - SQL_SUCCESS
SQLSetCursorName - SQL_SUCCESS
SQLStatistics - SQL_SUCCESS
SQLDataSources - SQL_SUCCESS
SQLDisconnect - SQL_SUCCESS
SQLDrivers - SQL_SUCCESS
SQLError - SQL_SUCCESS
SQLNativeSql - SQL_SUCCESS
SQLEndTran - SQL_SUCCESS
SQLCancel - SQL_SUCCESS
SQLSpecialColumns - SQL_SUCCESS
SQLMoreResults - SQL_NO_DATA
Do you need Lazarus/FreePascal commercial version of our products?
Single File System
© 2000-2017 AidAim Software
RAD Studio Components
Delphi Components Download
Multi User Database
Client Server Database System
Embedded SQL Database
Delphi Embedded Database
In Memory SQL Database
Fastest In Memory Database
Cookie consent script