Networking Visual FoxPro Database by Brute Force

There are variety of ways in networking databases in Visual FoxPro and today we will learn how to do it by brute force...Hopefully...

Preliminaries...

1. Ensure that you have a functional Local Area Network. For instance, if you want your PHONE DIRECTORY SYSTEM in StationA to be accessed in StationB, the first thing that you need to do is to start command prompt and ping StationB. Once you receive four packets response then both computers have working network connections. Additionally, make sure that both computers have file and printer sharing enabled.

2. Once network connection testing is complete and successful,you should now prepare your PHONE DIRECTORY SYSTEM for networked environment. Alter your source code and make sure that you have included the SHARED alias in your USE TABLE_NAME command. For instance, if your primary table is TFOXPHONEDIR, modify USE TFOXPHONEDIR to USE TFOXPHONEDIR SHARED. This will enable your table to be manipulated in a networked-based environment. Don't forget to save changes.

Almost there...

3. Next, create a program superlauncher for the first form of your PHONE DIRECTORY SYSTEM. To do this, press CTRL + F2 then type MODI COMM SUPERLAUNCHER in the command window. This command performs two things. It creates a Visual FoxPro program named superlauncher.prg and it displays the Visual FoxPro editor. Type the following in the FoxPro editor textarea:

DO FORM FIRSTFORMNAME

Don't forget to replace FIRSTFORMNAME with the actual firstname of your first form. For example if the filename of your first form is LOGINFORM.SCX, replace DO FORM FIRSTFORM with DO FORM LOGINFORM. CLick close to save changes.

4. Now, share the Microsoft Visual Studio Folder. This will enable your system to be available to all clients in the network, assuming that all your forms and databases are located inside the Visual Studio directory.

The finale...

5. To access your PHONE DIRECTORY SYSTEM in StationB or in any workstations in the network, browse your network places and locate your shared Microsoft Visual Studio folder. Look for your superlauncher.prg then double-click it.

6. In similar manner, double-click superlauncher.prg in StationA.You should now have phone directory systems activated in separate computers at the same time.

7. Though you are using the same form, it can perform independent actions in each workstations. To test your system, perform a record search in StationA, while one of your pals edits a record in StationB. Notice how it worked perfectly as mentioned. And that's all, a simple database networking  by brute force in VFP just for you.