3.4.3.Sample Application

OpenLink also provides a sample ODBC based dynamic SQL application that enables you verify usability of your ODBC installation. The sample application is situated within the "samples" sub-directory below your OpenLink installation directory. The ODBC sample application is called "odbctest".

The following steps guide you through the process of successfully utilising this sample application. This exercise presumes that we are connecting to a DSN called "SQL Server on NT", which connects us to a remote SQL Server Database hosted on a machine called "pluto" via the OpenLink Server components on an Windows 95/98/NT/2000 application server called "ntappserver".

  1. Ensure that your OpenLink Request Broker is up and running on the machine "ntappserver" (you can quickly confirm this by opening up your browser and entering the following URL: http://ntappserver:8000 )

  2. At your UNIX command prompt type in the following command:

    odbctest
    
  3. Enter a full or partial ODBC connect string at the ODBC applications command prompt, some examples are listed below:

    • for a list of DSNs on your system enter "?"

    • to connect to the DSN called "SQL Server on NT" type (this is a partial connect string): DSN=SQL Server On NT

    • to enter a username and a blank password combination along with the DSN type (this is a partial connect string only because we have a seperate server hosting the OpenLink Server and Microsoft SQL Server components): DSN=SQL Server on NT;UID=sa;PWD=

    • to enter a directive that instructs the OpenLink Server components to connect to the remote SQL Server hosted on the machine called "pluto", type the following (this is a full connect string for this particular scenario): DSN=SQL Server on NT;UID=sa;PWD=;OPTIONS=-s pluto

  4. If the previous step is successful you are now ready to execute SQL interactively against your remote database, to do this enter the following SQL command:

    select * from authors
    
  5. To quit this application type in "exit" at the SQL command line prompt.