|
- Overview
- Using the native xBase/FoxPro access
- Importing the structure of data files
- The import steps
- Taking into account the evolutions of the xBase/FoxPro files
- The important points regarding the programming
- New features for managing the xBase/FoxPro files
- Dynamic description of an xBase file
- Opening files that were described dynamically
- Opening indexes that were described dynamically
- Links between the xBase or FoxPro files
- Using the native xBase/FoxPro access with non-Latin character sets
Native xBase/FoxPro Access
Disponible solo con este tipo de conexión
WINDEV and WEBDEV propose a module for the Native Access to xBase/FoxPro. This Native Access allows you to handle the xBase/FoxPro files from a WLanguage program without using an external driver. Required configuration: The following files are supplied with WINDEV and WEBDEV: wdxxxdb.dll. This file is required by the Native Access on the xBase/FoxPro files in order to operate with a HFSQL Classic analysis. señalar: A partir de la versión 19, HFSQL es el nuevo nombre de HyperFileSQL. Using the native xBase/FoxPro access To use the native xBase/FoxPro access in your WINDEV or WEBDEV applications: - Import (if necessary) the description of xBase/FoxPro files into the WINDEV or WEBDEV analysis.
- Program with the HFSQL functions of WLanguage.
The management of the xBase/FoxPro files is similar to the management of the HFSQL files except for the cases explained in this help page. Importing the structure of data files The import steps - In the data model editor, start the import wizard ("Structure of files .. Import the descriptions of files/tables"). In the data model editor, start the import wizard: on the "Analysis" pane, in the "Creation" group, expand "Import" and select "Import the descriptions of files/tables".
- Select the type of database: FoxPro/xBase. A connection to the xBase/FoxPro database is automatically established and associated with the files imported into the analysis. This connection will have to be used to handle the xBase/FoxPro data file by programming.
- Specify whether the data must be kept in current format (option required to use the Native xBase/FoxPro Access).
- Select the access mode to the files (Native xBase Access for WINDEV) and specify the directory of data files.
- Select the tables that will be imported into the WINDEV analysis. These tables can be handled by programming with the HFSQL functions of WINDEV. These tables will be displayed in blue in the data model editor.
Note: the FoxPro databases (.dbc extension) are not supported. Each file (.dbf extension) must be individually imported into the analysis. - Validate. The tables are imported into the analysis. In the data file description, you find the xBase sub-type of the imported file (dBase3+, dBase4, FoxPro/FoxBase, Clipper5, Clipper87).
Notes: - An item defined as Numeric in FoxPro can be imported as currency into WINDEV and WEBDEV (if the size of the item exceeds the size of a real for example).
- The Logical items in xBase/FoxPro are imported as Text items. Indeed, for a boolean in xBase, you have the ability to specify True and False with the 'T' and 'F' strings.
Taking into account the evolutions of the xBase/FoxPro files To take into account the evolutions of tables imported into the data model editor, select "Structure of files .. Synchronize the analysis with the external databases". To take into account the evolutions of the tables imported into the data model editor, on the "Analysis" pane, in the "Analysis" group, expand "Synchronization" and select "Update the analysis from the external databases". A wizard starts, allowing you to: - analyze the differences for the imported tables,
- analyze the differences for all the xBase/FoxPro tables.
The important points regarding the programming New features for managing the xBase/FoxPro files The management of the xBase/FoxPro files is similar to the management of the HFSQL files except for the cases explained in this help page. New features regarding the management of xBase files since WINDEV 5.5: - Managing an automatic identifier.
- Ability to use HIndex.
- Management of expressions in HFilter.
- Ability to use HChangeDir.
- Using the native xBase access with non-Latin character sets.
Managing FoxPro files: - Support of memos in VFP format.
- All the index formats are supported (including the indexes in VFP format corresponding to the .CDX extension). The indexes are read and modified.
- Managing an automatic identifier.
- Management of expressions in HFilter.
- Ability to use HChangeDir.
- Limitation: no FoxPro file can be reindexed.
- Limitation: no FoxPro file can be created.
Dynamic description of an xBase file An xBase file can be described by programming by the following functions: | | HDBCreation | Ends the dynamic description of the file structure. The file that was just described is created on disk in the path specified in HDBDescribeFile. The data, memo and index files are created on disk. | HDBDescribeFile | Dynamically describes a file in dBase 3 format (most common format). This function is used to specify the name, abbreviation and access path of xBase file. | HDBDescribeIndex | Dynamically describes the different index files that will be created. An index file must be described for each search key. The created index file will be in dBase 3 format. | HDBDescribeField | Dynamically describes each item of the structure of an xBase file described by HDBDescribeFile. |
Example:
// Describe an xBase file containing the following items: // LASTNAME, string of 20 characters // FIRSTNAME, string of 20 characters // AGE, integer on 3 digits // BALANCE, real on 10 digits and 2 decimals // MARRIED, boolean // DOB, date // INFO, text memo
HDBDescribeFile("DBCUSTOMER", "CD", "C:\FILE\CUSTOMER.DBF") HDBDescribeField("LASTNAME,C,20") HDBDescribeField("FIRSTNAME,C,20") HDBDescribeField("AGE,N,3,0") HDBDescribeField("BALANCE,N,10,2") HDBDescribeField("MARRIED,L") HDBDescribeField("DOB,D") HDBDescribeField("INFO,M") HDBCréation()
Note: the FoxPro files cannot be described dynamically. Only the dBase 3 format is supported. Opening files that were described dynamically An xBase file is not automatically opened: this file must be opened by HDBOpen before its first use except if it was created by HDBCreation (that creates and opens the file). Opening indexes that were described dynamically HDBOpen opens the data file but not the index files. Therefore, you must open all the necessary index files for using the data file with HDBIndex. If the index files are not opened, they will not be updated after a deletion, a modification or an addition. Links between the xBase or FoxPro files The links are not automatically managed by WINDEV and WEBDEV. They must be managed by programming. Therefore, to access a record in the linked file, you must find the corresponding record according to the link key ( HReadSeek). Example: A window displays the orders of a customer, the "ORDERS" file contains the product number, the "PRODUCT" file contains the product caption and the product number. For example, the initialization process of the window is:
// Read the orders HReadFirst(ORDERS, Ord_Date) IF HOut() = False THEN // Find the corresponding product HReadSeek(PRODUCT, ProNum, ORDERS.ProNum) FileToScreen() END
Using the native xBase/FoxPro access with non-Latin character sets To use the native xBase access with non-Latin character sets, a standard OEM/ANSI conversion must be performed by the native access. To do so, the following string must be specified in the extended information: OEMTOANSI=WINDOWS; Example: - In the initialization code of the project, add the code used to modify the character set:
ChangeCharset(charsetChinese)
- Create an xBase connection:
HDescribeConnection("CntxBase", "", "", fExeDir(), "", hNativeAccessXBase, ... hOReadWrite, "OEMTOANSI=WINDOWS;") HChangeConnection("*", "CntxBase")
Esta página también está disponible para…
|
|
|
| |
| Haga clic en [Agregar] para publicar un comentario |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |