Foxhound is the better* Database Monitor for SQL Anywhere.
*better: More thorough, more relevant, more effective.
...more Alerts, more All Clears, more details, more control in your hands.


Breck Carter
Last modified: June 21, 1996
mail to: bcarter@bcarter.com



WINHELP.EXE Parameters

How can I execute WINHELP.EXE and have it jump directly to a specific topic instead of the contents? I have a application that executes other programs based on command line parameters retrieved from a database. Sometimes the other program is WINHELP.EXE and the user wants to provide specific Help topics as parameters.

WINHELP.EXE does indeed accept command line parameters:

   winhelp [<parameter>] <help file name>

   where the optional <parameter> can be one of:
      -k<keyword>          for "K" footnote
      -n<context number>   for "#" footnote context number
      -i<context ID>       for "#" footnote context string
      -h                   for "Help on Help"

This is useful beyond the special application described above. For example, Program Manager icons are very handy for directly opening specific Help files. With the WINHELP.EXE paramters you can also create different icons for different topics within the same Help file.

Figure 1: Help Icons

Figure 1 shows two icons which open two of the most useful PowerBuilder 4 Help files: One describes PowerBuilder itself and the other covers Watcom SQL 4. The third icon jumps to a useful but difficult to find topic within the Watcom Help file: A complete working example on how to create user groups that make it unnecessary to qualify SQL select statements with user ids.

The Program Manager items are defined as follows:

Description:  Pbhlp040
Command Line: c:\pb4\pbhlp040.hlp
Description:  Pbwat040
Command Line: c:\wsql40\win\pbwat040.hlp
Description:  User Groups
Command Line: winhelp -ian_example_of_user_groups c:\wsql40\win\pbwat040.hlp

It turns out that the -i parameter is the most useful of the three. Use Help - Search to find the topic you want, and if it contains spaces then change them to underscores when specifying the -i parameter.

Figure 2: User Group Example

Figure 2 shows what happens when you double-click on the User Groups icon. This topic could be its own Tip of the Day because it's so useful: Just copy the code more or less as-is to set up a "security.sql" file you can run to define basic groups and specific user ids in an empty Watcom SQL database. If you use the company user id to create tables and DataWindows then your users will be able to sign on with their own ids and use the database without qualifying every table name with its creator.

When you upgrade to PowerBuilder 5 and SQL Anywhere 5, don't throw away the pbwat040.hlp file. That's because this wonderful example appears to missing from dbeng50w.hlp.


Breck Carter can be reached by phone at (416) 763-5200 or via email at bcarter@bcarter.com.