How to Handle Embedded Space in Field Name in FoxProLast reviewed: June 27, 1995Article ID: Q130161 |
The information in this article applies to:
SUMMARYFoxPro does not support field names that contain spaces (embedded blanks). However, other database applications such as Paradox and Microsoft Access do. If you use the Connectivity Kit (CK), FoxPro can access the fields that contain spaces, but in order to reference the field in an SQL SELECT statement that is passed to DBExec(), you must surround the field name with square brackets - [ and ].
MORE INFORMATIONNative FoxPro does not support fields that contain spaces in the names. Therefore, when FoxPro retrieves data from another data source that contains a space in the field name, FoxPro replaces the space with an underscore. Many times it is necessary to access a field that contains a space in its name with a SQL SELECT statement that is passed to the DBExec() function. The following example demonstrates how to use the square brackets to reference the field name:
SET LIBRARY TO SYS(2004)+"fpsql.fll" handle=DBConnect("atest","","") =DBExec(handle,"select * from test where [abc def]='rec1'") =DBDisconn(handle) SET LIBRARY TO |
Additional reference words: FoxWin 2.60a ODBC
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |