On 10/18/2017 9:33 AM, eric wu wrote: > > how to re-write these codes below to a modern object-oriented > programming codes? And to be able to work with a database alias. > > > 1. to check if a table is exist > 2. if not, create one. > > thanks in advance! > Eric > > > local f > f = new file() > if not f.exists( "c:\Issu.dbf" ) > Create Table "C:\Issu.dbf" ( Name char(20), depType char(10) ) > endif > f = null >
// untested:
d = new database()
d.databaseName := "BDE Alias Name"
d.active := true
if not d.tableExists( "tablename" )
cSQL = "create table ..." // full SQL statement
d.executeSQL( cSQL )
endif
d.active := false
d = null