Task for the laboratory work (28068-1)Посмотреть архив целиком
1.Task for the laboratory work.
Build-in FoxProw commands
Practical usage of data of data transfer.
Technical facilities & literature used.
Task for the laboratory work.
The aim of this work is to show our ability to work with different Microsoft applications & to produce the data exchange between them, using build-in commands, OLE instruments & other possible facilities.
In the practical examples we will show the data transfer process using the following Microsoft Applications: FoxPro, Excel & Word.
Also it is necessary to present the theory about the data transfer for it is impossible to use all of them in the examples.
2. Theory part.
There are several different ways to transfer data from FoxPro to different Microsoft Applications & vice versa.
Built-in FoxPro commands.
Operator can use several built-in commands of FoxPro such as Export, Import, Copy and Append from.
Now we would like to present some helpful information about these operands.
The format of EXPORT is:
[[TYPE] DIF | MOD | SYLK | WK1 | WKS | WR1 | WRK | XLS]]
Use EXPORT to use FoxPro data in other software packages.
If the table/.DBF you are exporting from is indexed, the new file created is created in the indexed order.
Include the name of the file to which FoxPro exports data. If you do not include an extension with the file name, the default extension for the specified file type is assigned.
scope clauses are: ALL, NEXT
You can specify a scope of records to copy to the new file. Only the records that fall within the range of records specified by the scope are copied to the new file.
The default scope for EXPORT is ALL records.
the FOR clause is included, only records that satisfy the logical
optimizes an EXPORT ... FOR
the WHILE clause is included, records are copied to the new file for
as long as the logical expression
To cause Rushmore not to optimize EXPORT, include NOOPTIMIZE. For more information, see SET OPTIMIZE and the Rushmore discussion in the Optimizing Your Application chapter of the FoxPro Developer's Guide
You must specify the type of file to be created. The TYPE key word is optional, but you must specify one of the following file types.
you specify DIF, each field from a FoxPro table/.DBF becomes a vector
(column) and each record becomes a tuple (row) in a DIF (Data
Interchange Format) file, used by VisiCalc. The new file name is
assigned a .DIF extension if an extension isn't included in
the MOD clause to export to a file in Microsoft Multiplan version
4.01 MOD format. The new file name is assigned an .MOD extension if
you don't include an extension in
A SYLK file is a Symbolic Link interchange format (used by Microsoft Multiplan) in which each field from a FoxPro table/.DBF becomes a column in the spreadsheet and each record becomes a row. By default, SYLK file names have no extension.
Include this option to create a Lotus 1-2-3 spreadsheet from a FoxPro table/.DBF. A .WK1 extension is assigned to the spreadsheet file name for use with Lotus 1-2-3 revision 2.x. Each field from the table/.DBF becomes a column in the new spreadsheet, and each record in the table/.DBF becomes a spreadsheet row.
A Lotus 1-2-3 spreadsheet can be created from a FoxPro table/.DBF with this option. A .WKS extension is assigned to the spreadsheet file name for use with Lotus 1-2-3 revision 1-A. Each field from the table/.DBF becomes a column in the new spreadsheet, and each record becomes a row in the spreadsheet.
Include this option to create a Lotus Symphony spreadsheet from a FoxPro table/.DBF. A .WR1 extension is assigned to the spreadsheet for use with Symphony version 1.01. Each field from the table/.DBF becomes a column in the new spreadsheet, and each record in the table/.DBF becomes a row in the spreadsheet.
A Lotus Symphony spreadsheet can be created from a FoxPro table/.DBF with this option. A .WRK extension is assigned to the spreadsheet file name for use with Symphony version 1.10. Each field from the table/.DBF becomes a column in the new spreadsheet, and each record in the table/.DBF becomes a row in the spreadsheet.
Include XLS to create a spreadsheet you can use in Microsoft Excel. Each field in the +selected table/.DBF becomes a column in the spreadsheet; each table/.DBF record becomes a row in the spreadsheet. An .XLS file name extension is assigned to the newly created spreadsheet file unless you specify a different extension.
The format of IMPORT is:
FW2 | MOD | PDOX | RPD | WK1 | WK3 | WKS | WR1 | WRK | XLS
As it shown in format (TYPE) there are many possible Microsoft applications to import from to FoxPro but the meaning of these properties, description of which you can see in the previous chapter, that’s why it’s not necessary to list all of them again. So we will mention those most common used.
Most software packages store their data in a file format that cannot be opened directly in FoxPro. IMPORT creates a new FoxPro table/.DBF from data stored in file formats that FoxPro cannot read.
A new table/.DBF is created with the same name as the file the data is imported from. A .DBF extension is assigned to the newly created table/.DBF.
The key word TYPE is optional, but you must include one of the following file types described below.
Include PDOX to import Paradox files. Database files in Paradox versions 3.5 and 4.0 by Borland can be imported by including the PDOX option.
Include XLS to import data from Microsoft Excel spreadsheets versions 2.0, 3.0 and 4.0. Columns from the spreadsheet become fields in the table/.DBF, and the spreadsheet rows become records in the table/.DBF. Spreadsheet files created in Microsoft Excel have an .XLS extension.
The format of COPY is:
[[WITH] CDX] | [[WITH] PRODUCTION]
[[TYPE] [FOXPLUS | DIF | MOD | SDF | SYLK| WK1 | WKS | WR1 | WRK | XLS |
If an index order is set, records are copied in master index order.
name of the new file to which COPY TO copies data is specified with
If you include FIELDS and a field list, you can specify which fields are copied to the new file. If the FIELDS clause is omitted, all fields are copied to the file. If the file you are creating is not a database, memo fields aren't copied to the new file even if memo field names are included in the field list.
scope clauses are: ALL, NEXT
You can specify a scope of records copied to a file. Only the records that fall within the range of records specified by the scope are copied.
The default scope for COPY TO is ALL records.
optimizes COPY TO with a FOR
Чтобы не видеть никакую рекламу на сайте, нужно стать VIP-пользователем.
Это можно сделать совершенно бесплатно. Читайте подробности тут.