Database development and training for Birmingham and the midlands
Specialists in Microsoft Access and Visual Foxpro database training and development
I am happy to hear from existing clients but I am taking no new calls.
Visual Basic and Visual FoxPro text delimiters
VFP'single' or "double" quotes or [square brackets]
Common Syntax Notes
Neither FoxPro nor VBA distinguish between a string of text and a character. They use the same data type and delimiters for both.
Visual Basic Syntax Notes
VBA only supports the double quote as a string delimiter so you often find yourself having to use the ASCII code Chr(34) when you want to use the double quote inside a string, typically when wanting to use an SQL command:
set rst = rst.openrecordset(strSQL)
Visual FoxPro Syntax Notes
The variety of delimiters in Visual FoxPro make it easy to embed strings inside other strings. Paradoxically, FoxPro needs this flexibility less than Visual Basic because Fox accepts SQL commands as part of its native syntax. There's no need to wrap the SQL and pass it as a string to a DAO method, FoxPro will just execute it directly as a command:
You might however want to set the where clause of an SQL statement at runtime and then assign that SQL statement to the RowSource property of a control. We've used two types of quote in the SQL already but we can use the third delimiter around the entire string:
There's no hierarchy between the three delimiters in FoxPro so this alternative would be equally valid.