VDF-GUIdance logo



  Visual DataFlex Logo
  

Shared knowledge leads to accumulated knowledge

        Printer Friendly Page


Size: 17 KB Download
Date Created: 09/06/2000
Date Updated: 09/06/2000
Author: Geoff Furlong
Company: MSG Business Systems Ltd.
Summary:
This is a program to let your applications log in to Oracle from one main starting point.
The application is designed to work with the Oracle driver from Mertech, but could easily be changed to support other database drivers as well

Oracle VDF Application Launcher

By Geoff Furlong, August 2000
Ever wanted to have a stand-alone program that will prompt and login to Oracle and then chain your program? There are samples out there but these remain limited.

The following code uses Runtime registry entries or workspaces to generate a list of available applications for the launcher to "chain" to once logged into Oracle.
The latest Mertech drivers do have an automatic login feature that will popup, if you or your user tries to open a file whose rootname starts with "ORA_DRV". This works great, but sometimes it is just not sufficient.
In most of my apps, I want to log in before anything in the app starts such as initialisation processes.
This program will do the trick.

Installing the Launcher

You must have a VDF runtime registry key like the following. You can use the enclosed Oracle_Login.reg as a starting point:


REGEDIT4

[HKEY_LOCAL_MACHINE\Software\Data Access Corporation\Visual DataFlex\5\Oracle_Login]
"VDF"="Oracle_Login"
"ChainTo1"="The Big Application (Big)"
"ChainTo2"="Order Entry (Order)"
"ChainTo3"="Contact Address Book (Contact)"
"ChainTo4"=""
"ChainTo5"=""
"ChainTo6"=""
"DFPath"=".;X:\\Oracle_Login;Y:\\VDFx\\Bin;Y:\\VDFx\\Lib;Y:\\VDFx\\Usr"


Note that each "ChainTo..." entry is an entry in the combo-list in the panel above.

(Where X: is where the Oracle_Login program's workspace lives and Y: is where you're VDF directories are.)

Compiling the Source Code

Just create a directory, e.g. X:\Oracle_Login, and download the files listed below into it. Compile using either the default DFPath or the one listed above. The resulting Oracle_Login.vd? can be launched from anywhere since it requires no data files.

Note that the workspace, runtime key or VDF program name is in brackets. These "ChainTo..." values in the registry, are used to fill a combo form object in the launcher which provides a user-defined list of "chainable". This is important since the launcher extracts these from the filled combo form so it can launch the required application. programs.

Starting the Launcher From The Command Line/Shortcut

You can create a shortcut with a command line:

Y:\VDFx\Bin\DFRun.exe Oracle_Login {Server} {MyUserName} {MyPassword}

If Server, MyUserName and MyPassword are used, their values will appear in the launcher as a default.

Server will be the Net8 or SQLNet TNSName you've created to connect to an Oracle database.

The "Chain To" Combo Form

As mentioned earlier, this is filled with entries from the launcher's registry settings. After successfully logging the user onto the Oracle database, the selected application in this combo form will be chained/activated.

The "This is my application's username and password" Checkbox

If you have checked this checkbox, the user ID and password used to login to Oracle will be added to the command line parameters of the application the launcher will "chain to". This is useful if you have a login panel on an application and you don't want users to have to login twice. You can simply change the launched application to pickup the username and password from the command line parameters supplied by the launcher and suppress the application's login panel if there is a successful login to the application.

THE LAUNCHER!

You can download the VDF5.1 executable from:
http://www.msg.uk.com/Geoff/Oracle_Login/Oracle_Login.vd5
You can download the VDF6.2 executable from:
http://www.msg.uk.com/Geoff/Oracle_Login/Oracle_Login.vd6

The Code

You can download the following files from the MSG website:
The source File
The Oracle bitmap used in the Launcher
A sample registry settings file (Rightclick your mouse, file save as)
A sample shortcut for running the launcher with a default server, user and password.
You can also download the complete sources as a zipped up package from VDF-GUIdance.

Oracle Login ~ zip file 17 kb