Setting up SQL Server connection

 

You can use an existing SQL Server database to work with Lycia or you can create a new one. Lycia uses the ODBC connection to connect to SQL Server.

Here are the general instructions to be used for an SQL Server database creation and connecting to it using Lycia.

The steps described below can be used for Windows only. To connect to SQL Server from UNIX/Linux use the FreeTDS ODBC driver for UNIX, which is a third party product used to provide SQL Server connectivity tools from UNIX.

 

 

Step 1

Install SQL Server as instructed in the SQL Server documentation and create your database

 

 

Step 2

Configure your DSN using the Administration Tools/Data Sources (ODBC) manager located within ‘Control Panel’

 

 

Step 3

Create a DSN using "System DSN" tab:

   

 

 

 

Step 4

Press the Add button and select the driver for the DSN. Then specify the name of the DSN (e.g. qx_odbc) and select the server:

 

Description: ODBC_db

 

 

Step 5

Select the authentication mode, test the connection and close the ODBC Administrator window as well as the Connect tool by pressing OK buttons

 

 

Step 6

Record the details of the database connection to database.cfg file

 

 

Step 7

Set the database driver to "sserver" as described here

 

 

Step 8

Restart LyciaStudio. using the File -> Restart main menu option LyciaStudio loads the environment variables from the files when it is started, they are not modified dynamically. Thus each modification of the environment variables which influence LyciaStudio must be followed by the Studio restart. If you use Lycia Command Line Environment, you do not need to restart it after having set the variables

 

 

 

 

Connecting to a database in GUI mode is rather tricky, if your application is running on an application server without authentication (i.e. default).

An application using this post is run as the service owner and this means that all database connections are using the same user ID. Thus it is advisable to use the full authentication port (secure)

 

 

In some cases you may need to set the ODBC_DSN variable. This variable should contain the name of the DSN you want to connect to, e.g. ODBC_DSN=qx_odbc. It is not required and you can omit it. The following actions are performed by the 4GL depending on the availability of this variable:

 

This variable is set like all the other environment variables for LyciaStudio, for the GUI and for the command line environment.