This document explains how to add your own ODBC drivers to H-Sphere Winbox.
Interface
The following scripts are used:
odbc-getdrivers.asp
odbc-getparams.asp
odbc-createdatasrc.asp
odbc-updatedatasrc.asp
odbc-deletedatasrc.asp
odbc-getdrivers.asp
- description:
- returns a list of available ODBC divers
- parameters:
- none
- return value:
- successful - 0<list of driver names>
- fail - error message
odbc-getparams.asp
- description:
- returns a list of addmissible attributes for this ODBC driver
- both methods "GET" and "POST" are supported
- parameters:
- driver - driver name
- return value:
- successful - 0<list of admissible driver attributes>
- fail - error message
odbc-createdatasrc.asp
- description:
- creates new data source
- only "POST" method is supported
- parameters:
- driver-name
- DSN - name of the new data source
- user-name - user's accout name
- <list of admissible attributes of this ODBC driver and their
values>
- return value:
- successful - 0
- fail - error message
odbc-updatedatasrc.asp
- description:
- updates parameters of the existing data source
- only "POST" method is supported
- parameters:
- driver-name
- DSN - name of the new data source
- user-name - user's accout name
- <list of admissible attributes of this ODBC driver and their
values>
- return value:
- successful - 0
- fail - error message
odbc-deletedatasrc.asp
- description:
- deletes existing data source.
- both "GET" and "POST" methods are supported
- parameters:
- driver-name
- DSN - name of the new data source.
- user-name - user's accout name
- return value:
- successful - 0
- fail - error message
Configuration
To configure ODBC use a file of the below format.
Full path to this file is registered in conf.inc (the "ODBCIniFile"
variable). By default it is called "odbcdrv.ini" and sits in the
directory with ASP scripts.
This file has a usual windows .ini file format, i.e.
is broken into sections with headings enclosed in square brackets.
Every section corresponds to an ODBC driver, its name being the
heading of the section. The body of the section includes driver
attributes in the following format:
<attribute name>=<type>|<default value>|<description>|[<value1[;value2[;value3...]
where:
- <attribute name> - name of the ODBC driver attribute
(e.g. DBC)
- <type> - typically a string of the type: <typeid>_[required|optinal],
where typeid is the name of the type, e.g. "string",
that can be required or optional depending on the parameter. Can
take the following values:
- path_required - required path (an individual path
type is required to identify relative path to userhome dir)
- path_optional - optional path
- string_required - required string
- string_optional - optional string
- string_password - password
- integer_required - mandatory integer value
- integer_optional - optional integer value
- select_required - mandatory list of values
- select_optional - optional list of values
- trigger - radio-button switch
- <default value> - default value for the given attribute;
a space if missing (NOT AN EMPTY STRING!)
- <description> - attribute description
- <value1[;value2[;value3... - values for the list;
must be filled only for the 'select' types. Use semicolon (;)
as delimiter.
To add a new ODBC driver to the ODBCIniFile, add a new section
with the heading identical to the name of the driver and the attributes
that are described according to the above rules.
Note: When a user enables an ODBC resource, H-Sphere lists drivers that can be found both among those
installed on the server and those in the odbcdrv.ini file. The obcdrv.ini file contains:
- [Microsoft Paradox Driver (*.db )]
- [Microsoft Access Driver (*.mdb)]
- [Microsoft Visual FoxPro Driver]
- [Microsoft dBase Driver (*.dbf)]
- [Microsoft Excel Driver (*.xls)]
- [SQL Server]
- [MySQL]
- [MySQL ODBC 3.51 Driver]
- [PostgreSQL]
|