Microsoft KB Archive/150551

= INFO: Duplicate Fields Naming Differs in Local and Remote View =

Article ID: 150551

Article Last Modified on 10/15/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Data Access Components 2.5

-



This article was previously published under Q150551



SUMMARY
When you're using the local or remote view designers to create views with multiple tables, note that duplicate field names in the output fields list are not the same in a local view versus a remote view.



MORE INFORMATION
In a local view, when you add duplicate field names to the output field list, the fields are renamed by adding the underscore character (_) followed by a sequential alpha character.

For example, if a field named Cust_ID is added to the output fields list of a local view more than once, the first occurrence of this field is renamed to Cust_ID_a, and the second occurrence is renamed to Cust_ID_b.

In a remote view, the duplicate fields are renamed by adding a sequential number to the second and all subsequent occurrences of the field name. For example, if a field named Cust_ID is added to the output fields list of a remote view more than once, the first occurrence of this field is named Cust_ID, and the second occurrence is renamed to Cust_ID1.

This is the default behavior of the local and remote view designers and cannot be changed by the user. The only way to control the renaming of duplicate fields in a view is to create the view programmatically using the CREATE SQL VIEW command. When you create the views programmatically, the fields can be renamed using the AS clause of the SQL SELECT command.

The following example creates a remote view named View1 on two tables named TBL1 and TBL2. Both tables contain a field named Cust_ID. This remote view renames the duplicate fields to Cust_ID_a and Cust_ID_b. CREATE SQL VIEW View1 REMOTE CONNECTION MyConnection AS SELECT ; TBL1.Cust_ID AS Cust_ID_a, TBL2.Cust_ID AS Cust_ID_b   ; FROM TBL1, TBL2 NOTE: If this remote view is later modified by using the remote view designer and then saved, the fields are renamed to the remote view designer's defaults of Cust_ID and Cust_ID1.

Additional query words: VFoxWin ODBC

Keywords: kbinfo KB150551

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.