main | demo | docs
download | community | pike
2000 Roxen Internet Software
Suggestions, Comments or Complaints

DocsRoxen2.0Administrator ManualDatabases

  • ODBC
  • SQL tag module
  • SQL databases
  • ODBC

    To connect to a database through ODBC is a bit different from using the databases supportred natively. You need to install a ODBC driver for the database and then configure it to connect to your database manager. On Windows the configuration is simple and done through the ODBC control panel.

    On Unix the configuration is done through an .odbc.ini file. The .odbc.ini file is usually found in the home directory of the user Roxen was started as. It can also be specified in the ODBCINI environment variable.


    The .odbc.ini file can contain configurations for several databases. The syntax is as follows:

    Driver = path
    option = value

    Name is the name you give the database. Driver is the path to the ODBC driver, in form of a dynamic library. Option is various options that will be forwarded to the driver. Which options are available differ between different drivers. Usually the location of the database manager and maybe the name and password of the database user.

    An example of a .odbc.ini file:

    # white page of metro Toronto
    Driver = /usr/lib/odbc/

    # NNTP netnews group
    Driver = /usr/lib/odbc/
    Server =

    # data source for R&D test
    Driver = /home/r_d/odbc/
    URL = empodbc://

    Database URL

    The database URL for a database reached through ODBC is odbc://user name:password@name/database, where name is the name given the database in the .odbc.ini file or the ODBC control panel. Instead of writing the database user and password in the database URL you can write them as options in the .odbc.ini file.