VFP allows you to use SQL commands directly within the command window or programs. This is often faster than using native XBase commands like LOCATE or SEEK .
Use the TEXT...ENDTEXT command to include long blocks of SQL or documentation within your code for easy reading. visual foxpro programming examples pdf
loExcel = CREATEOBJECT("Excel.Application") loExcel.Visible = .T. loWorkbook = loExcel.Workbooks.Add() loSheet = loWorkbook.ActiveSheet SELECT Customer SCAN lnRow = RECNO() loSheet.Cells(lnRow, 1).Value = Customer.CustID loSheet.Cells(lnRow, 2).Value = Customer.Name ENDSCAN Use code with caution. 5. Essential Program Control VFP allows you to use SQL commands directly
* Create a new table CREATE TABLE Customer (CustID C(5), Name C(30), Joined D) * Add a new record INSERT INTO Customer (CustID, Name, Joined) VALUES ("C001", "Alice Smith", DATE()) * Browse the data BROWSE TITLE "Customer List" Use code with caution. 2. Working with SQL in VFP loExcel = CREATEOBJECT("Excel