"Cannot Define Primary" in Paradox Table (111046)
The information in this article applies to:
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 5.0
- Microsoft Query
This article was previously published under Q111046 SUMMARY
In Microsoft Query, when you create an index for an existing Paradox
table, you may receive the following error message:
Cannot define primary
CAUSE
This error message appears if the table you are creating an index for
contains data. You cannot create a unique index for a Paradox table
that contains data.
WORKAROUND
To create an index on a field in a Paradox table, do either of the
following: - Open the table in Paradox and assign a primary key to one of the
fields in your table. Until you define a primary key in the
table, you cannot edit the data in the table in Microsoft Query.
-or-
- To create a new Paradox table from the existing table, and create
an index for the new table in Microsoft Query, do the following:
- From the File menu, choose New Query. From the Available Data
Sources list, select Paradox Files and choose Use.
- From the Table Name list, select the table for which you want
to add an index, and choose Add. Choose Close.
- From the Field List, drag the asterisk to the data pane.
- From the File menu, choose Save As. From the Save As list,
select Paradox Files and choose Save. In the File Name box,
type the name of your new table. Select the Save Indexes check
box, and choose OK.
- Choose Yes to create a unique index in the table.
- In the Index Name box, type the name of the table you saved in
step 4 (the name of the primary index must match the name of
the table). From the Index Fields list, select the name of the
field you want to index. Choose Add.
These steps will create a new table with the fields and data contained in
the original Paradox table.
REFERENCES
For more information about the Create Index Dialog Box, or the Table
Definition Command (File Menu), choose the Search button in
Help and type:
Modification Type: | Minor | Last Reviewed: | 8/15/2005 |
---|
Keywords: | KB111046 |
---|
|