Difference between revisions of "Lianja ODBC Manager on Windows"

From Lianjapedia
Jump to: navigation, search
(Lianja DSN Configuration)
 
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==See Also==
 
==See Also==
[[Lianja SQL Server Manager]], [[SQL System Tables]]
+
[[Lianja ODBC Driver on Linux]], [[Lianja ODBC Driver on Windows]], [[Lianja Server Manager on Linux]], [[Lianja Server Manager on Windows]], [[SQL System Tables]]
  
 
==The Lianja ODBC Manager==
 
==The Lianja ODBC Manager==
Line 10: Line 10:
 
If you have User Account Control enabled, please click Yes on the UAC dialog displayed when you run the Lianja ODBC Manager.  On Windows XP, please run the Lianja ODBC Manager as the Administrator.
 
If you have User Account Control enabled, please click Yes on the UAC dialog displayed when you run the Lianja ODBC Manager.  On Windows XP, please run the Lianja ODBC Manager as the Administrator.
 
<br clear=all>
 
<br clear=all>
 +
 +
<div style="height:70px;margin-top:15px;padding:5px;border:0px solid orange;border-left:5px solid orange;background:#fff8dc;vertical-align:middle;position:relative;">
 +
[[File:bm-noteicon.png|top|40px|link=]]<div style="position:absolute;top:7px;bottom:5px;margin-left:50px;">
 +
The Lianja ODBC Manager is used for Lianja ODBC Driver data sources only.  If you want to create or manage data sources for other ODBC Drivers for use from Lianja, do this in the [[#Windows_ODBC_Administrator|32 bit Windows ODBC Adminstrator]].
 +
</div>
 +
</div>
  
 
==Lianja ODBC Data Source Manager==
 
==Lianja ODBC Data Source Manager==
Line 21: Line 27:
  
 
The buttons give you access to the following operations:
 
The buttons give you access to the following operations:
 +
<br clear=all>
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
 
!Operation||Description
 
!Operation||Description
 
|-
 
|-
|valign=top|Delete||Delete the currently selected DSN.
+
|valign="top"|Delete||Delete the currently selected DSN.
 
|-
 
|-
|valign=top|Add||Configure a new DSN.
+
|valign="top"|Add||Configure a new DSN.
 
|-
 
|-
|valign=top|Edit||Configure the currently selected DSN.
+
|valign="top"|Edit||Configure the currently selected DSN.
 
|-
 
|-
|valign=top|Close||Close the Lianja ODBC Manager.
+
|valign="top"|Close||Close the Lianja ODBC Manager.
 
|-
 
|-
 
|}
 
|}
Line 38: Line 45:
  
 
==Lianja DSN Configuration==
 
==Lianja DSN Configuration==
 +
The '''Connection Information''' tab contains all the standard configuration details.  The optional '''Settings''' and '''Logging''' tabs are for optional settings.
 +
 +
===Connection Information===
 +
[[{{ns:file}}:ConnectionInformation.png|150px|thumb|left|Connection Information tab]]
 +
Note: The Lianja SQL Server product distribution, which includes the Lianja ODBC Driver, comes with a fully-configured DSN to the southwind sample database on the local machine.
 +
 
The following settings can be configured:
 
The following settings can be configured:
 +
<br clear=all>
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
!Section||Item||Description
+
!Setting||Description
 
|-
 
|-
|valign=top|Port Listener||Retries||Number of times a connection attempt will be tried before returning an error.  Default is 29.
+
|valign="top"|DSN||Unique data source name.
 
|-
 
|-
|||valign=top|Delay||Number of seconds the Port Listener will wait to verify that the server it called was successfully started.  Default is 10.
+
|valign="top"|Description||Description of data source.
 
|-
 
|-
|||valign=top|Timeout||Number of seconds between each connection attempt.  Default is 1.
+
|valign="top"|Server||Host name or IP address of Lianja SQL Server.
 
|-
 
|-
|valign=top|Directory Paths||Root Directory||The Lianja SQL Server root folder.
+
|valign="top"|User||User name of valid account on the server.  For the local server, this can be '?'.  From v5.0 this must be a [[Users and Roles|valid Lianja user]].
 
|-
 
|-
|||valign=top|Log files||The default folder for Lianja SQL Server log files.
+
|valign="top"|Password||Password for the above account on the server.  For the local server, this can be '?'.  From v5.0 this must be the password for the [[Users and Roles|Lianja user]] above.
 
|-
 
|-
|||valign=top|Error files||The default folder for Lianja SQL Server error files.
+
|valign="top"|DATABASE or DIRECTORY||DATABASE: The name of the database on the server. DIRECTORY: The directory path where free tables are stored.
|-
+
|||valign=top|Temporary files||The default folder for Lianja SQL Server temporary files.
+
|-
+
|||valign=top|Database||The default folder for Lianja SQL Server databases.
+
|-
+
|||valign=top|Services||The default folder for Lianja SQL Server background script services.
+
|-
+
|valign=top|Environment||Cursors||Maximum concurrent cursors.
+
|-
+
|valign=top|Log Files||Enabled||Check to enable log file creation.
+
|-
+
|||valign=top|Versions||Check to enable log file versioning.
+
|-
+
|||valign=top|Listener||Click to view the current Listener log file
+
|-
+
|||valign=top|Server||Click to view the current Server log file
+
|-
+
|||valign=top|Purge||Click to purge all log files
+
 
|-
 
|-
 
|}
 
|}
  
[[{{ns:file}}:Settings.png|150px|thumb|left|Settings tab]]
+
<div style="height:70px;margin-top:15px;padding:5px;border:0px solid orange;border-left:5px solid orange;background:#fff8dc;vertical-align:middle;position:relative;">
 
+
[[File:bm-noteicon.png|top|40px|link=]]<div style="position:absolute;top:7px;bottom:5px;margin-left:50px;">
Note: When the Lianja SQL Server service is started, the Port Listener is activated and listens for client requests. Once a client makes a connection, the Port Listener starts the Server for that connection.
+
From Lianja v5.0 Lianja [[Users and Roles]] are used to authenticate ODBC clients on the Lianja Server.<br>This means that [[Users_and_Roles#Row_level_Security_.28RLS.29|Row level Security]] and [[Users_and_Roles#Dynamic_Data_Masks|Dynamic Data Masks]] are also applied to Lianja data accessed via ODBC.
 
+
</div>
One client could have more than one connection / Server.
+
</div>
 
+
At any one time, there will be only one Port Listener process, but there may be many Server processes.
+
 
+
Note: Logging should only be enabled when required, not for general usage.
+
 
+
  
 +
[[{{ns:file}}:ConnectDiagnostics.png|150px|thumb|left|Connection Diagnostics]]
 +
To test the connection, click '''Apply''' to apply your settings, then click '''Diagnostics...''' to open the Lianja ODBC Diagnostics window and click '''Test''' in the Configuration dialog to run the test.
 
<br clear=all>
 
<br clear=all>
==Background Scripts==
 
[[{{ns:file}}:BackgroundScripts.png|150px|thumb|left|Background Scripts tab]]
 
The Background Scripts tab allows for the creation, modification and configuration of background service scripts.
 
Background service scripts can be used to perform data transformation, data synchronization or any other custom operation on your data that you require in your Apps.
 
  
Background service scripts run with no UI. They are primarily used to perform data collection tasks or batch job tasks such as checking for new or updated data and emailing out notifications to Lianja users.  Typically a background service will sleep for a period of time and then repeat its work.  Background service scripts have the standard program extensions of prg/dbo and reside in the services sub-folder of the Lianja SQL Server root (see Settings above for default folders).  Whenever the Lianja SQL Server service is started, any programs in the services folder with their Startup Mode set to Automatic will be run.
+
===Settings===
 +
[[{{ns:file}}:DSNSettings.png|150px|thumb|left|Settings tab]]
 +
Additional optional settings can be configured here:
 
<br clear=all>
 
<br clear=all>
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
!Section||Item||Description
+
!Section||Setting||Description
 
|-
 
|-
|valign=top|Scripts||Script||Script name
+
|valign="top"|Database||Row ID||Include the rowid (number identifying the row’s physical stored position in the table) in results.
 
|-
 
|-
|||valign=top|Status||Service status: Stopped, Started
+
|||valign="top"|Readonly||Open tables in noupdate mode.
 
|-
 
|-
|||valign=top|Startup Mode||Service startup mode: Manual, Automatic.
+
|||valign="top"|Exclusive||Open tables in exclusive mode.
 
|-
 
|-
|valign=top|Buttons||valign=top|New...||Create a new script.
+
|valign="top"|Login||Encryption||Open tables with DES3 encryption key specification required.
 
|-
 
|-
|||valign=top|Edit...||Edit the selected script.
+
|}
 +
 
 +
===Logging===
 +
[[{{ns:file}}:Logging.png|150px|thumb|left|Logging tab]]
 +
Client and server logging and ODBC tracing can be enabled and configured here.
 +
<br clear=all>
 +
 
 +
{| class="wikitable" width="100%"
 +
!Section||Setting||Description
 
|-
 
|-
|||valign=top|Delete||Delete the selected script.
+
|valign="top"|Client||Enable Logging||Check to enable client-side logging.
 
|-
 
|-
|||valign=top|Mode (Automatic or Manual)||Toggle the startup mode of the selected script between Automatic and Manual.
+
|||valign="top"|Enable Tracing||Check to enable client-side tracing.
 
|-
 
|-
|||valign=top|Refresh||Refreshes the display
+
|||valign="top"|Log To File||Name of log file.  The Browse button allows the file to be selected, the View button the file to be viewed.
 
|-
 
|-
|||valign=top|Status (Started or Stopped)||Toggle the status of the selected script between Started and Stopped.
+
|valign="top"|Server||Logging||Check to enable server-side logging.
 +
|-
 +
|||valign="top"|Name||Name of server-side log file.
 
|-
 
|-
 
|}
 
|}
 
===Template Background Script===
 
<code lang="recital">
 
//============================================================================
 
//
 
// FILE        :  example.prg
 
//
 
// PURPOSE      :  Example code for a Lianja background service script on Windows.
 
//
 
//----------------------------------------------------------------------------
 
//
 
// Background service scripts are called with two parameters:
 
//
 
// script      :  full path name of the script
 
// action      :  Either "start", "stop" or "restart"
 
//
 
//-----------------------------------------------------------------------------
 
//
 
// Functions
 
//
 
// start()      :  Called when the service is started. Creates a
 
//                  filename.active and processes all actions while this
 
//                  file exists.
 
//
 
// stop()      :  Removes the filename.active file so the service will
 
//                  stop when it next wakes up to do any work.
 
//
 
// doWork()    :  This is the place to add your main processing code.
 
//
 
//============================================================================
 
 
//-----------------------------------------------------------------------------
 
// declare global variables
 
//-----------------------------------------------------------------------------
 
public p_active_file
 
public p_error_file
 
public p_sleep_seconds
 
 
//-----------------------------------------------------------------------------
 
// Start action
 
//-----------------------------------------------------------------------------
 
function start( )
 
    // Check to see if a ".error" file already exists for this script
 
    // and delete it if it does.
 
    if file(p_error_file)
 
        erase &p_error_file
 
        if file(p_active_file)
 
            erase &p_active_file
 
        endif
 
    endif
 
 
    // Check to see if a ".active" file already exists for this script
 
    // and return if its already active
 
    if file(p_active_file)
 
        return .f.
 
    endif
 
 
    // Create the ".active" file for this script
 
    fp = fcreate(p_active_file)
 
    if ferror() = -1
 
        return .f.
 
    else
 
        fclose(fp)
 
    endif
 
 
    // process any work for this script
 
    do while file(p_active_file)
 
        sleep p_sleep_seconds
 
        doWork()
 
    enddo 
 
return .t.
 
 
//-----------------------------------------------------------------------------
 
// Stop action
 
//-----------------------------------------------------------------------------
 
function stop( )
 
    // Erase active file so service will stop
 
    erase &p_active_file
 
 
    // return result
 
    if file(p_active_file)
 
        rc = .f.
 
    else
 
        rc = .t.
 
    endif
 
return  rc
 
 
//-----------------------------------------------------------------------------
 
// error handler
 
//-----------------------------------------------------------------------------
 
function errorHandler( )
 
    on error
 
    save error to &p_error_file
 
    stop()
 
return
 
 
//-----------------------------------------------------------------------------
 
// function to handle the requested script action
 
//-----------------------------------------------------------------------------
 
function handle_action(action, sleepTime, scriptName)   
 
    // Setup exit handler
 
    on finish stop()
 
 
    // Setup error handler
 
    on error errorHandler()
 
 
    // by convention we use files prefixed by the script name and postfixed with
 
    // .active and .error to keep us informed of the script execution status
 
    p_active_file = lower(basename(left(scriptName, at(".", scriptName) -1)+".active"))
 
    p_error_file = lower(basename(left(scriptName, at(".", scriptName) -1)+".error"))
 
    p_sleep_seconds = sleepTime
 
 
    // Change the default directory as thats where the .active status file is written
 
    set default to "C:\Lianja\sqlserver\services"
 
   
 
    // handle the specified action
 
    do case
 
        // Start service
 
        case upper(action) = "START"
 
            result = start()
 
 
        // Stop service
 
        case upper(action) = "STOP"
 
            result = stop()
 
 
        // Restart service
 
        case upper(action) = "RESTART"
 
            stop()
 
            result = start()
 
 
        // Unknown command
 
        otherwise
 
            result = .f.
 
    endcase
 
return result
 
 
//-----------------------------------------------------------------------------
 
// this is the function that will be executed by this script to handle its work
 
//-----------------------------------------------------------------------------
 
function doWork( )
 
 
    // TODO: add your own custom code here
 
 
return
 
 
//-----------------------------------------------------------------------------
 
// Call the Lianja background service script action handler
 
//-----------------------------------------------------------------------------
 
return (handle_action(_para1, 10, procname()))
 
</code>
 
  
 
==Windows ODBC Administrator==
 
==Windows ODBC Administrator==
[[{{ns:file}}:ServiceManager.png|150px|thumb|left|Service Manager tab]]
+
[[{{ns:file}}:ODBCAdministrator.png|150px|thumb|left|ODBC Administrator]]
 
Lianja ODBC data sources can also be managed using the Windows ODBC Administrator.  Please note that on 64 bit systems, the 32 bit ODBC Administrator should be used (%windir%\SysWOW64\odbcad32.exe).
 
Lianja ODBC data sources can also be managed using the Windows ODBC Administrator.  Please note that on 64 bit systems, the 32 bit ODBC Administrator should be used (%windir%\SysWOW64\odbcad32.exe).
 
<br clear=all>
 
<br clear=all>
  
[[Category:Configuration]]
+
[[Category:Lianja SQL Server]]
[[Category:SQL Server]]
+
[[Category:Lianja Server]]
[[Category:ODBC]]
+

Latest revision as of 05:34, 5 September 2019

See Also

Lianja ODBC Driver on Linux, Lianja ODBC Driver on Windows, Lianja Server Manager on Linux, Lianja Server Manager on Windows, SQL System Tables

The Lianja ODBC Manager

The Lianja ODBC Manager allows you to create, edit and delete Lianja ODBC data sources. It can be accessed from its desktop shortcut or from the Windows Start Menu under Lianja.

Start Menu

User Account Control

If you have User Account Control enabled, please click Yes on the UAC dialog displayed when you run the Lianja ODBC Manager. On Windows XP, please run the Lianja ODBC Manager as the Administrator.

Bm-noteicon.png

The Lianja ODBC Manager is used for Lianja ODBC Driver data sources only. If you want to create or manage data sources for other ODBC Drivers for use from Lianja, do this in the 32 bit Windows ODBC Adminstrator.

Lianja ODBC Data Source Manager

Lianja ODBC Data Source Manager

The Lianja ODBC Data Source Manager displays your currently configured data sources:

  • Data Source Name (DSN)
  • Type (System, User, File)
  • Description

The buttons give you access to the following operations:

Operation Description
Delete Delete the currently selected DSN.
Add Configure a new DSN.
Edit Configure the currently selected DSN.
Close Close the Lianja ODBC Manager.

Choosing either of the Configure operations displays the Lianja DSN Configuration dialog.

Lianja DSN Configuration

The Connection Information tab contains all the standard configuration details. The optional Settings and Logging tabs are for optional settings.

Connection Information

Connection Information tab

Note: The Lianja SQL Server product distribution, which includes the Lianja ODBC Driver, comes with a fully-configured DSN to the southwind sample database on the local machine.

The following settings can be configured:

Setting Description
DSN Unique data source name.
Description Description of data source.
Server Host name or IP address of Lianja SQL Server.
User User name of valid account on the server. For the local server, this can be '?'. From v5.0 this must be a valid Lianja user.
Password Password for the above account on the server. For the local server, this can be '?'. From v5.0 this must be the password for the Lianja user above.
DATABASE or DIRECTORY DATABASE: The name of the database on the server. DIRECTORY: The directory path where free tables are stored.
Bm-noteicon.png

From Lianja v5.0 Lianja Users and Roles are used to authenticate ODBC clients on the Lianja Server.
This means that Row level Security and Dynamic Data Masks are also applied to Lianja data accessed via ODBC.

Connection Diagnostics

To test the connection, click Apply to apply your settings, then click Diagnostics... to open the Lianja ODBC Diagnostics window and click Test in the Configuration dialog to run the test.

Settings

Settings tab

Additional optional settings can be configured here:

Section Setting Description
Database Row ID Include the rowid (number identifying the row’s physical stored position in the table) in results.
Readonly Open tables in noupdate mode.
Exclusive Open tables in exclusive mode.
Login Encryption Open tables with DES3 encryption key specification required.

Logging

Logging tab

Client and server logging and ODBC tracing can be enabled and configured here.

Section Setting Description
Client Enable Logging Check to enable client-side logging.
Enable Tracing Check to enable client-side tracing.
Log To File Name of log file. The Browse button allows the file to be selected, the View button the file to be viewed.
Server Logging Check to enable server-side logging.
Name Name of server-side log file.

Windows ODBC Administrator

ODBC Administrator

Lianja ODBC data sources can also be managed using the Windows ODBC Administrator. Please note that on 64 bit systems, the 32 bit ODBC Administrator should be used (%windir%\SysWOW64\odbcad32.exe).