Article ID: 174807
Article Last Modified on 1/29/2007
MD HOME()+"..\ztest"
*-- In Visual FoxPro 6.0:
*-- USE HOME(2)+"data\customer.dbf"
USE HOME()+"samples\data\customer.dbf"
COPY TO HOME()+"..\ztest\customer.dbf"
CD HOME()+"..\ztest"
CLOSE DATABASE ALL
CREATE DATABASE Ztest
MODIFY DATABASE Ztest NOWAIT && NOWAIT only if in a program
CLOSE TABLES ALL
SET DATABASE TO Ztest
DO HOME()+"tools\gendbc\gendbc" WITH "Ztest"
CREATE SQL VIEW "ZTEST" ;
AS SELECT * FROM ztest!customer
to the following:
CREATE SQL VIEW "ZTEST" ;
AS SELECT * FROM ztest!customer WHERE country ="USA"
This creates a view that lists only the customers whose country field
contains "USA." Copy only the code that creates the SQL View into the
Ztest2 program. If you copy all the code from Ztest.prg, it will
re-create both the table and the SQL view contained within the database.
However, all the data for the Customer table is lost.
Additional query words: gendbc view
Keywords: kbdatabase kbhowto kbsqlprog KB174807