fxodbc: Microsoft ODBC

A database interface to an ODBC database. This program is available on Windows systems only.

To access data with fxodbc, you must have installed the necessary ODBC software components (i.e. the Driver Manager, Drivers etc.). These are normally distributed by the vendor responsible for supplying the drivers. Once installed, the ODBC Administrator, located in the Control Panel, may be used to configure one or more databases. If necessary, this process also embeds the means of accessing the database across a network.

Connect String

An ODBC connect string, typically specified via a command line option, takes the following form:

-c=<dataSourceName>

where <dataSourceName> is the ODBC data source connection string. e.g.

-c="dsn=mydb;uid=myuser;pwd=mypwd"

Components of the connection string may be separated with , or ;
The connection string may or may not be enclosed within quotes depending on the contents of its components.

Different databases require different components in their connection strings. This is beyond the scope of this document, but in our example the database is an Access database on a Windows system.
Typically, a user and password is necessary.

If a key=value component does not contain a key= part, this component is assumed to be the dsn name and dsn= is prepended, e.g.

-c="mydb;uid=myuser;pwd=mypwd"

To hide any sensitive connection information from prying eyes, an encoded string may be used. The utility fxencode is available for such encoding.

Extensions to Standard Commands

objfetch

objfetch {into} <client_name>

fxodbc implements this command but since the ODBC database is non-spatial, it cannot return graphic entities to the client. Instead it returns null graphic entities, i.e. gstructures with attributes but with null geometry.

plsql

fxodbc does not implement PL/SQL facilities.

Additional Commands

query_tables

query_tables {<client_string_array>}

Return the names of all tables in the database into a client string array. If the parameter is omitted the table names will simply be listed.

SQL Type Translation

The following table gives the mappings between ODBC datatypes and the Eim data which the translator produces to represent them:

ODBC

Eim/Fire

SQL_BIGINT

not supported

SQL_BINARY

not supported

SQL_BIT

numeric

SQL_CHAR

string

SQL_DATE

time

SQL_DECIMAL

numeric

SQL_DOUBLE

numeric

SQL_FLOAT

numeric

SQL_INTEGER

numeric

SQL_LONGVARBINARY

not supported

SQL_LONGVARCHAR

not supported

SQL_NUMERIC

numeric

SQL_REAL

numeric

SQL_SMALLINT

numeric

SQL_TIME

not supported

SQL_TIMESTAMP

time

SQL_VARBINARY

not supported

SQL_VARCHAR

string