Difference between revisions of "Virtual Tables - Local Development, Remote Deployment"
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 94: | Line 94: | ||
[[Category:Developers Guide]] | [[Category:Developers Guide]] | ||
+ | [[Category:Third Party Database Connectivity]] |
Revision as of 08:21, 17 September 2014
Lianja allows you to develop using virtual tables connected to local data, then - by setting the Runtime connection attribute for the App - to deploy your App to use an alternative connection available on the client.
Contents
See Also
- Syntax for the CREATE VIRTUALTABLE and ALTER VIRTUALTABLE Commands
- Properties and Methods of the CursorAdapter Class
Introduction
In the example here we do the following:
- Use the Import ODBC database utility in Lianja to connect to an Oracle server via the Oracle ODBC Driver and import the 'hr' tables required by my App. The utility also automatically creates virtual tables for these local copies.
- Develop the App using the virtual tables, without needing to be connected to the Oracle server.
- Set the Runtime connection on the App to the target client's Oracle DSN and set the App's Published flag to true.
- Deploy the App
Create 'local' virtual tables
Firstly, we need local Lianja copies of the target data (Oracle 'hr' sample here). We can use the Import ODBC database utility for this via the Oracle ODBC Driver (32 bit). In the Lianja App Builder, select the Data Workspace and create a new database or open the database you want to use. Then select Import ODBC database from Additional commands.
In the Import ODBC Database dialog:
- Specify the Oracle ODBC DSN and its associated Username and Password.
- Check the Create Virtual Tables box to automatically create 'local' virtual tables for the imported tables.
- Click the Tables button to display the available tables.
- Check the required tables.
- Click Import
The Console Workspace will be selected automatically and the import progress displayed. Once the import has completed, issuing the dir command in the Lianja/VFP command window displays the tables and virtual tables that have been created. Note that the virtual tables have a connstr of 'local'.
At this stage, the connection to the Oracle server is no longer required.
Develop locally
Develop the App using the virtual tables.
Remember to check the box next to the Published attribute for the App in Settings so that it will appear in the Lianja App Center and also to complete the settings for the App's App Center tile.
Finally, set the Runtime connection attribute to be the DSN or connection string the target client will use, including the authentication information if required.
Create an Installer or other method of deploying the App. The screenshot shows the files to be included for a local deployment.
Deploy remotely
Once deployed, the App's virtual tables will use the Runtime connection.