The module named PCMiles contains the declarations section. The macro named PCMilerStart opens the engine connection. The macro named PCMilerEnd closes the connection. In the Database Window, if you select the Query button, you will see some examples to calculate miles, get latitude/longitudes, etc.
Before selecting any Query, you must run the Macro named PCMilerStart. If this is not done, all results will be -1.
If you get an error saying that ‘PCMSRV32.DLL is not found’, then check to see if you have a copy of the PCMSRV32.DLL and PCMSERVE.INI in your Windows folder. You can also update the module named PCMiles with the proper directory of the PCMSRV32.DLL.
Once the engine is connected, you can select any Query and run.
In order to properly shut down the connection to PC*MILER|Connect, run the macro named PCMilerEnd.
Example for calculating distances between two places:
1. Open the database named accdem32.mdb.
2. Run the macro named PCMilerStart.
3. Run the query named Calculate Miles.
4. Enter Origin as Princeton, NJ
5. Enter Destination as Trenton, NJ.
The query returns the origin, destination and the distance between them in miles.