Creating Client-Server Solutions with Microsoft Visual FoxPro

Click to open or copy the project files.

Presented by: Joe Homnick

Joe Homnick is a Florida CPA and lead instructor with Homnick Systems, a Microsoft Authorized Technical Education Center. He is a Microsoft Certified Trainer and has more than 12 years of Microsoft FoxPro/Xbase development experience. As lead instructor with Homnick Systems he oversees the only true hands-on training facility for FoxPro, Microsoft SQL Server, Microsoft Visual Basic, and Microsoft Access. Located in Boca Raton, Florida, Homnick Systems offers hands-on training that allows students to incorporate their own projects into the course, thereby promoting practical learning while students advance their projects at the same time.

Client-Server and Visual FoxPro

This presentation employs Microsoft® SQL Serverfor Windows NT 4.21a as a back end, all examples and sample code reference the demonstration "pubs" database that Microsoft SQL Server for Windows NT ships with.

Client-server development is gaining momentum as more companies select these systems to expand their existing systems and right size those old mini and mainframe databases. Microsoft SQL Server for Windows NT has turned what used to be a costly and complicated process into something that most firms can quickly and affordably assimilate.

Client-server is a system that centrally processes databases and sends the results of commands back to clients. This centralized processing scheme is excellent for databases that require large numbers of users and/or remote access. The Microsoft SQL Server for Windows NT database is also very popular due to its excellent security, ability to handle vast amounts of transactions, fail safe operation and scalability. The following figure illustrates the difference between a distributed database such as Microsoft Visual FoxPro™ and a centralized or client-server database such as Microsoft SQL Server for Windows NT.

Once you have settled on a client-server solution, such as the Microsoft SQL Server for Windows NT, you have only actually decided on the database engine, you must still have a programmable "front end," so that end users can access this back end. The Microsoft SQL Server for Windows NT ships with a couple of front end tools named Object Manager and System Administrator. These tools are designed for high level manipulation of the database and are not meant to be end user tools for data entry, querying and reporting. The developer must still decide on a front end. Visual FoxPro is an excellent choice for this development environment. The developer must look at three main areas in Visual FoxPro when pulling together the application, connecting, querying and updating.

These operations can be performed using two methods. The developer can create views and manipulate the server tables much like native Microsoft FoxPro® tables or use a method known as SQL Pass Through (SPT). SPT is a method of passing through Transact-SQL native to the back end, with a result set being returned to the FoxPro environment. As we investigate these three main areas we will look at how to use both of these methods to accomplish the desired effects.