Using Visual FoxPro to Generate Data-centric Web Pages (Page 1 of 4 )
In this article, you will learn how to export a table to Visual FoxPro from Microsoft Access. You will also see how easy it is to generate web pages with Visual FoxPro.
Introduction
The current version of Visual FoxPro is 9.0; a newer version is well on its way. VFP is a tool that handles most business applications which have moderate levels of both transactional processing and data size. Its data-centric origins are aided by a powerful object model with its own programming language that can handle queries not possible with the standard SQL. These features have made it very attractive.
While it remained apart like a loner from other Microsoft products, version 9.0 will see an enhancement in the next version, code-named, Sedna which will integrate with the .Net framework. Even in version 6.0 it had excellent support for bringing data to the web in a painless manner, even better than MS Access. The main objective of this tutorial is to export a table to Visual FoxPro from MS Access and show how easy it is to generate web pages.
Exporting tables to Visual FoxProVisual FoxPro can work with different database products such as Lotus, Dbase, Paradox, Excel, and so on. Fig.1 shows a table in an MS Access database called ToFoxPro.mdb that is to be exported to a Dbase IV format table. The Orders table has some 830 records.
Fig.1 
Fig.2 shows the design view of the table. In this view it is easy to see the primary key, the indexing of the columns, and so on.
Fig.2
The table can be exported by clicking on File in the main menu and then clicking on Export after highlighting the table to be exported. This brings up the window "Export Table 'Orders' To" shown in Fig.3, where it opens with the default of exporting to an MS Access file type. You must use the drop down to select dbase IV (*.dbf) format as shown. Visual FoxPro can also handle dbase III and dbase5 file types. When you choose the format to export to, the title of the window changes to "Export Table 'Orders' As." Now you click on the Export button and you will see the Orders.dbf file in the default directory, My Documents.
Fig.3 
Now this file can be accessed from Visual FoxPro. Start Visual FoxPro from its shortcut on Start -> All programs. From the File menu click on open, which opens up the default folder with default file extensions, Project(*.pjx, *.fpc, *.cat) which you change to Table(*.dbf) by the drop down and the My Documents folder to search. This will show up the Orders.dbf you created earlier. Highlight this and click OK. This brings up the Code Page window as shown where you choose the locale related code.
Fig.4
In here, you choose the Windows radio button and click on Select which sets the locale related code page to 1252 Windows ANSI. It rebuilds the names of tags to remove white space in conformity with its own naming scheme. Now you may browse and look at the table by going View ->Browse from the main menu as shown in Fig.5.
Fig.5 
This brings up the Orders.dbf table to be displayed as shown in Fig.6. Comparing with the original table you may notice the changes that have taken place. The Formatting has changed considerably from the original as well as the column names.
Fig.6

Next: Visual FoxPro Table Features >>
More Visual Basic.NET Articles
More By Jayaram Krishnaswamy