ODBC Setup Instructions for AOLserver 3.0+

This document provides instructions for establishing an ODBC database connection with the Win32 version of AOLserver 3. The Win32 version of AOLserver 3 includes an ODBC driver in the bin directory named nsodbc.so (the file should actually be named nsodbc.dll and may be named that in later AOLserver releases but either way, despite the extension, the driver is a valid Win32 dll and only named .so for distribution purposes). The steps to establish an ODBC connection follow:

  1. Create a System DSN to your Datasource - You've probably already done this. If not go to Control Panel -> ODBC Data Source -> System DSN -> click 'Add', and follow the instructions on screen. Make sure to remember the name you give your DSN.

     

  2. Configure AOLserver to make the ODBC connection - For this you'll need to modify your nsd.tcl. Below we've included the sections/parameters you'll need to add. If you have questions about the specifics of the parameters we mention consult the Configuration File Reference section of the AOLserver Admin Guide.

    First you'll need to set the driver to be loaded into AOLserver. Add

    ns_param nsodbc nsodbc.so
    

    to the ns/db/drivers section of your nsd.tcl. If the section doesn't exist you'll have to create it:

    ns_section "ns/db/drivers"
    ns_param nsodbc nsodbc.so
    

    Next configure a database pool in AOLserver. Add a section named ns/db/pool/YourPoolName and specify the necessary parameters. The datasource parameter should be the name of your DSN. For the specifics of what the parameters can be see the ns/db/pool section of the Configuration File Reference; you'll probably only need the parameters in our example:

    ns_section "ns/db/pool/odbctest"
    ns_param Driver      "nsodbc"
    ns_param Connections "5"
    ns_param Datasource  "DataSourceName"
    ns_param User        "sa"
    ns_param Password    "saPassword"
    ns_param Verbose     "On"
    

    Add an entry under ns/db/pool to specifiying the new pool and give the database pool a description. Example:

    ns_section "ns/db/pools"
    ns_param odbctest   "MS SQL Server test"
    

    Finally, make sure your ns/server/server-name/db section has access to your pool and the DefaultPool is set to what you want. Example: ns_section "ns/server/${servername}/db"

    ns_param Pools       *
    ns_param DefaultPool "odbctest"
    

     

  3. Verify the ODBC Connection works: Restart AOLserver, check your Server Log for errors, and make sure you can execute queries against your database.

If you have problems with the above steps feel free to email us at aolserver@am.net

Tuning Config Params | ODBC/SQL Server Setup | ns_column | ns_table | ns_radius
 

© Copyright 1996-2014 by am.net and Solitex Networks. Legal Notices.
Creative Commons License Articles on this site are licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.