Contents:
Introduction
News blog
What is Servoy?
Getting Started
Comparison Servoy/VFP
Performance
How-To's
Code Reference
VFP2Servoy Toolkit
Contact / feedback
|
How to use VFP data in Servoy
With Servoy 6.0, creating a data connection to native Visual FoxPro data, in a database container or in free tables, is easy.
To create a new connection do the following:
1. Go to the Solution Explorer and right click the Database Servers node which is directly under the Resources node.
2. Choose the option FoxPro DBF from the submenu
3. Change the default c:\temp data directory to the directory where the .DBC or free tables are located.
4. Change the Server Name to your liking.
5. Press Ctrl+S to save the changes.
6. In the Solution Explorer activate the new connection/database server.
In the lower half of the Solution Explorer check the existing tables:
As you may know, Servoy always needs a Primary Key in each table to uniquely identify a record. If your tables don't have primary keys then assign them first. However is you are using free tables
it is not possible to assign a PK because it doesn't exist for free tables. There is a workaround though. Make sure there is always a field with a unique value in the table, if not add one and fill it with RECNO().
If you change tables outside of Servoy then you will have to reload the database structure first. You can do this by right-clicking the Database Server connection and clicking the option
Reload tables/table structure from DB.
Now back to our workaround. Right-click the table in the lower half of the Solution Explorer and select edit table/view. If your table has a PK it will be shown as in the figure below. If it doesn't then you
will have to tell Servoy which field to use as the unique row identitifier by clicking in the row ident column of the corresponding row and selecting row_ident from the combobox/dropdown list and save the
changes.
Note that there is also a column called Sequence Type, here you can specify if Servoy should take care of filling your PK or if you want to let the database generate a auto-sequence for you. Be aware that
locks placed in VFP will not be respected or visible to Servoy and vice-versa. This is due to the nature of the database where administrative locks are used. If you use locks between multiple Servoy clients there is no problem.
Should you consider upgrading VFP data to PostgreSQL/SQLServer/MySQL? It depends on your situation, but as a rule of thumb, if there are no good reasons not to, then you should :-).
|
External resources:
vfp plugin
ServoyWorld 2012 pics
Official Servoy website
Ken Levy on Servoy
Servoy info
Servoy Forum
Servoy Documentation
|