The driver installation includes an ODBC application called Example that can be used for:

  • Testing any type of SQL statement
  • Testing database connections
  • Verifying your database environment

It can also be used to demonstrate ODBC function calls, including the following:

  • SQLAllocHandle
  • SQLBindCol
  • SQLBindParameter
  • SQLColAttribute
  • SQLConnect
  • SQLDescribeCol
  • SQLDescribeParam
  • SQLDisconnect
  • SQLDriverConnect
  • SQLExecDirect
  • SQLFetch
  • SQLFreeHandle
  • SQLFreeStmt
  • SQLGetDiagRec
  • SQLGetInfo
  • SQLNumResultCols
  • SQLPrepare
  • SQLSetEnvAttr
  • SQLSetStmtAttr

The Example application can be built using the files located in the \samples\examples directory of the DataDirect for ODBC Drivers installation directory.

Note:
  • For Windows, you can build the Windows app for ANSI and Unicode.
  • For UNIX/Linux, instructions for building the Example application are contained inside the file example.mak, which can be read with a text editor.

To use the Example application:

  1. After you have configured the data source, navigate to the instal_dir\samples\example directory.
  2. Open the application using one of the following methods:
    • Running the application executable or binary:
      • On Windows, double-click the Example.exe file.
      • On UNIX/Linux, run the example application.

    • Executing a command-line argument. For example:
      • example connection_string
      • example "DSN" "UID" "PWD"
      • example connection_string "sql_command_1" ["sql_command_2" ...]
    Results: A command prompt opens.
  3. Follow the prompts to enter your data source name, user name, and password. If successful, a SQL> prompt appears.
  4. At the prompt, enter SQL statements to test your connection. For example:

    SELECT * FROM INFORMATION_SCHEMA.TABLES

The results of your query are displayed. If example is unable to connect, the appropriate error message is returned.