Lianja ODBC Driver on Windows

From Lianjapedia
Revision as of 07:14, 7 February 2013 by Yvonne.milne (Talk | contribs)

Jump to: navigation, search

Before Using the Lianja ODBC Driver

Before using the Lianja ODBC Driver, complete the following steps:

  1. Download and install the driver. The driver is included in the Lianja SQL Server distribution and a client driver-only Lianja ODBC Driver distribution. The driver requires a local or remote Lianja SQL Server to operate.
  2. Select your Lianja database or create it in the Lianja App Builder Data Workspace or using SQL.
  3. Copy or Deploy your database to the Lianja SQL Server Database directory.
  4. Make sure the Lianja SQL Server service is running.
  5. Create a DSN for your data source in the Lianja ODBC Manager and test the connection.

Using ODBC Data Sources in the Lianja App Builder

Your Lianja ODBC DSN (as well as third-party ODBC data sources) can be accessed from the Lianja App Builder in the following ways:

ODBC Console


  • By Importing the data into a new local database
Import ODBC Database


Lianja ODBC Driver Additional Functionality

Full Lianja SQL documentation can be found here: SQL.

Calling Stored Procedures

Stored Procedures can be called using the CALL command. Stored procedures are .prg script files residing in a database's directory. For example, the script sp_demo.prg has been created in the southwind database in the Lianja App Builder:

Stored Procedure

It takes a parameter, selects data and returns the data as a resultset:

// sp_demo.prg
lparameters lcState
select account_no, state from example;
 where state = lcState;
 into cursor curExample
return setresultset("curExample")


After being deployed to the Lianja SQL Server database directory, it can be called when an ODBC connection to the southwind database is active:

nhand = sqlconnect("Lianja_Southwind")
if nhand > 0
	nret = sqlexec(nhand,"call sp_demo('MA')","mycursor")
	if nret > 0
		select mycursor
		browse
	endif
	sqldisconnect(nhand)
endif