BUG: ALTER TABLE Cannot Create a Descending Primary Key (186242)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0
  • Microsoft Visual FoxPro for Macintosh 3.0b

This article was previously published under Q186242

SYMPTOMS

The ALTER TABLE command cannot create a descending primary key index.

RESOLUTION

Use the Visual FoxPro interface to visually create a primary descending index key.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a program that contains the following code and run the program:
          USE home()+"samples\data\customer"
          MODIFY  STRUCTURE
          INDEX ON cust_id TAG cust_id DESCENDING
          MODIFY STRUCTURE
          ALTER TABLE customer ADD PRIMARY KEY cust_id TAG cust_id
          MODIFY  STRUCTURE
  2. When the first Table Designer window appears, click the Indexes tab and note both the Order and Type for the Cust_id tag. The Indexes tab name is Index in Visual FoxPro 3.0. Click OK.
  3. Overwrite the Cust_id key when the warning message appears. Click the Indexes tab on the Table Designer window, noting that the Cust_id key is now a regular index type in descending order. Click OK.
  4. Overwrite the Cust_id key again when prompted. Click the Indexes tab of the Table Designer window. The Cust_id key is now a primary index key, but it is in ascending order.

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbbug kbnofix KB186242 kbAudDeveloper