Share via

DBF Table named Order in VFP

Paul Waldner 0 Reputation points
2026-02-03T00:46:31.6266667+00:00

DBF Table named Order in VFP i think you can't have a tlb named order can anyone help with this problem.

Update ORDER ;

SET ORDER.GROUP = 'Apples' ;

WHERE ORDER.GROUP == 'Apple'
SQL Server Database Engine

Answer recommended by moderator

  1. Paul Waldner 0 Reputation points
    2026-02-12T14:48:38.82+00:00

    Thanks to all who replied to my question

    I got it fixed by renaming my table it was not ideal but it fixed my problem

    again thanks for your response

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Erland Sommarskog 133.9K Reputation points MVP Volunteer Moderator
    2026-02-03T22:24:04.14+00:00

    Possibly, you can use double quotes:

    UPDATE "ORDER"
    SET "GROUP" = 'Apples' 
    WHERE "GROUP" = 'Apple'
    
    
    

    That is the ANSI standard for quoting identifiers, but if FoxPro supports that I have no idea. You are using a tag for SQL Server, and different database products have different dialects of SQL.


  2. Q&A Assist
    2026-02-03T00:46:37.97+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    In Visual FoxPro (VFP), the use of reserved keywords as table names can lead to issues. The word "ORDER" is a reserved keyword in SQL, which is used for sorting results. Therefore, using it as a table name can cause confusion or errors in your queries.

    To avoid this problem, you can either rename your table to something that is not a reserved keyword or use square brackets around the table name in your SQL statements to indicate that it is a table name rather than a keyword. For example:

    UPDATE [ORDER] 
    SET [GROUP] = 'Apples' 
    WHERE [GROUP] = 'Apple'
    

    This way, you can successfully execute your SQL statement without running into issues related to the reserved keyword.

    If you are working with SQL Server, similar principles apply regarding reserved keywords. However, the context provided does not include specific guidance on VFP, so it's important to refer to VFP documentation for further assistance.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.