ACC: Exporting WordPerfect Secondary Files to Microsoft AccessLast reviewed: June 6, 1997Article ID: Q99317 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. This article describes how to export data from a WordPerfect (WP) print merge secondary file (or data file) to Microsoft Access.
MORE INFORMATIONA WordPerfect secondary file (or data file) contains records, typically names and addresses, used in a print merge with a primary file (or form file), such as a form letter or mailing label document. To use data from a secondary file, the information must be saved in a comma or tab delimited (separated), unformatted text file. WordPerfect secondary files are neither comma nor tab delimited. A typical comma delimited text file resembles the following:
"Joe","Smith","123 Main Street","Seattle, WA 98033" "Martha","Jones","4523 Williams Ave","","Redmond, WA 98052"The equivalent WordPerfect secondary file resembles the following:
Joe{END FIELD} Smith{END FIELD} 123 Main Street{END FIELD} Seattle, WA 98033{END FIELD} {END RECORD} <CRLF> Martha{END FIELD} Jones{END FIELD} 4523 Williams Ave{END FIELD} {END FIELD} Redmond, WA 98052{END FIELD} {END RECORD} <CRLF>where <CRLF> represents a hard page break. Note also that in Wordperfect versions later than 5.1, {END FIELD} and {END RECORD} will be shown as boldface without braces.
Problems: Secondary Files With Multiple-Line Field EntriesWordPerfect allows you to merge multiple lines of data in a single field. The following record has only two fields:
Joe Smith{END FIELD} 123 Main Street Suite 101 Seattle, WA 98033{END FIELD} {END RECORD} <CRLF>Delimited text files use carriage returns to mark the end of a record; these cannot be included in the field information. Each line in the secondary file must be made a unique field before it can be prepared as a delimited file. When you add the {END FIELD} code to a record, the new field is represented in every record in your file. Each record must contain the same number of fields and each field should either contain the same type of data or remain empty.
Using the {FIELD NAMES} Section in a Secondary FileFields in a secondary file can be referenced from a primary file by number. These fields are numbered from top to bottom, or by a name that is assigned in the optional {FIELD NAMES} section, which appears at the top of the secondary file. The {FIELD NAMES} section in WP 5.1 may look like this
{FIELD NAMES} Name~ Address~ ~{END RECORD}or like this:
{FIELD NAMES}Name~Address~~{END RECORD}The {FIELD NAMES} section in WP versions later than 5.1 may look like this:
FIELDNAMES(Name;Address)ENDRECORDIf referenced by number, the Name field is 1 and the Address field is 2. A hard page break falls between this section and the first record.
Preparing the Comma Delimited Secondary FileWordPerfect for Windows: WordPerfect for Windows can save secondary files directly in a comma delimited format. However, if you have a {FIELD NAMES} section in the file and want to preserve these names in Microsoft Access, you must reformat the file so that each name is separated by a comma and not by a tilde (~) character. Also, the fields should not appear on separate lines, nor be followed by carriage returns. The following {FIELD NAMES} section
{FIELD NAMES} Name~ Address~ Phone~ ~{END RECORD}should be edited as follows:
{FIELD NAMES}Name,Address,Phone{END RECORD}Creating the Comma Delimited File:
WordPerfect for MS-DOS cannot save secondary files directly in a delimited format. To create the comma delimited file, you need to create a primary file (or form file) and merge the secondary information into it. The primary document will contain fields already in comma delimited format. Once the data is merged, remove the hard page breaks separating each record. The resulting document can be saved as a text file that Microsoft Access can import. Creating the Primary File (or form file) in WP 5.1:
REFERENCES"WordPerfect for DOS Reference," version 5.1, pages 420-431 "WordPerfect for DOS Workbook," version 5.1, pages 237-246 "WordPerfect for Windows Reference," version 5.1, pages 300-308 "WordPerfect for Windows Workbook," version 5.1, pages 203-210 "WordPerfect for Windows Reference," version 5.2, pages 321-328 "WordPerfect for Windows Workbook," version 5.2, pages 227-236 "WordPerfect for DOS Reference," version 6.0, pages 412-422 "WordPerfect for DOS Learning WordPerfect," version 6.0, pages 195-204 "WordPerfect for Windows Reference," version 6.0, pages 453-473 "WordPerfect for Windows Learning WordPerfect," version 6.0, pages 201-210 |
Keywords : IntpPrtm kb3rdparty kbinterop
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |