Search code examples
foxpro

Foxpro database queries using Microsoft Query field header


I'm an normally used to querying other databases and just getting used to Foxpro. In other database I can do the following

SELECT fieldname as 'My Field Name'
FROM MyDatabase

And the header of that column would literally be My Field Name. However the foxpro output is always in lowercase i.e my field name

Does anyone know how to fix this please?

Thanks John


Solution

  • You can't. The 'AS' clause doesn't allow any characters for the column in the result cursor that would not be allowed in creating actual and DBF field name. That includes spaces.

    In addition the casing of fields in the DBF header is upper casee. If the table is part of a database container, the latter can hold a 'long name' for each field which can be up to 128 characters and have spaces, casing and so on. But retrieving DBF data through ODBC or OLEDB will always use the lowercased 10 character field name in the DBF header.