SQLFind - (C) Copyright 2006, Incode Systems, Inc. All Rights Reserved.
SQLFind performs a database lookup and performs an action using the looked up data. It is designed to be called from other programs, and by default centers itself on the topmost window on the screen. It may be launched from a shortcut and centered on the screen. All the specifications controlling database access and the lookup parameters are contained in a simple text file in the same format as an INI file.
Close This option would be appropriate when the user just wants to view the lookup data on the screen.
Execute Executes a program using data from the lookup as parameters.
Data Writes the data to a tab file.
Clipboard Copies the data to the clipboard.
Below is an example file containing the lookup specs. Like all INI files, lines preceeded with a semicolon (;) are comments.
[Window] ;Caption=Window Caption ;Width=200 ;Height=500 [Database] ConnectString=DSN=Accounting [Find] SQL=SELECT LastName,FirstName,EmpNo FROM dbo.Contacts WHERE EmpNo > '' AND LastName >= ? AND FirstName >= ? MaxRows=50 ;KeyCount is the number of columns used to perform the lookup, ; this must correspond to the parms (?) in the SQL KeyCount=2 ;ColCount is the number of columns from the SQL in the grid ColCount=3 ;ColHead is comma separated list of column headings for the grid ColHead="Name, Last",First Name,EmpNo ;ColWidths=50,50,50 (ColWidth is automatically sized for any ColWidth not defined) ;Required=1,2 ;Center=1 (centers SQLFind on the screen, default is center on TopMost window) ;HelpFile=myhelp.htm (may be any file with a registered extension, http: or www.) [Action] ;Action section defines what happens when you click the ;OK button (or press Enter) ;Action=Close/Execute/Data/Clipboard ; (if Action is undefined or invalid, nothing happens) ;Action=Close ; SQLFind closes. This could be used when the user just ; wants to be able to see what is looked up. ;Action=Execute ; program (FileNm) is executed with parameters (Parms), ; or file is launched with Operation, using ShowCmd (default = ShowNormal) ;Action=Data ; writes selected row in grid to file in FileNm ;Action=Clipboard ; copies selected grid row to the clipboard as tab-delimited text ;Note: FileNm, Operation, Parms, and Path may contain ; environment variables (example: %PATH%) or references to ; the column number of the selected row ; (example: &1; for first column) Action=Execute FileNm=%LOCALSERVER%\System\Programs\Payroll.exe ;Operation=open (any operation registered for the filetype) Parms=-Key:&3; Path=c:\work (defines working directory for launch) ;ShowCmd=Hide/Maximize/Minimize/Restore/Show/ShowDefault/ShowMaximized/ShowMinimized/ShowMinNoActive/ShowNA/ShowNoActivate/ShowNormal ;Close=1 (if Close=0, SQLFind does not close after action) ;Wait=0 (if Wait=1, SQLFind waits for action to complete before continuing)