Create Database
Posted: Fri Feb 14, 2020 7:22 am
Roger,
I have always just created new databases manually, but I have to do one to copy to a csv, so the field names are not relevant. It is a special export for invoices with wayyyyyyyyyyyy too many fields.
Anyway, I want to create a database and use an array to assign the fields (ie, data001-datea110) all the same field length, c30.
I tried to use your examples but it just give an error, even for one field (testing it). No ch files are missing, if they are necessary.
Tried on like this, but all give an error
aStru := { ;
{ 'DESC', 'C', 50, 0 }, ;
{ 'INTERPRET', 'C', 5000, 0 } }
dbCreate( cPath + 'DCSCRIPT.DBF', aStru, 'DBFNTX' )
Does not like the array set up. I must be missing something. I would rather create a loop on an array. to create the fields
'DATA'+strzero(n,3) where n is the next field up to 110. But I cannot get by the array structure(?)
Any suggestions is appreciated.
Thanks
Fred
Omni
I have always just created new databases manually, but I have to do one to copy to a csv, so the field names are not relevant. It is a special export for invoices with wayyyyyyyyyyyy too many fields.
Anyway, I want to create a database and use an array to assign the fields (ie, data001-datea110) all the same field length, c30.
I tried to use your examples but it just give an error, even for one field (testing it). No ch files are missing, if they are necessary.
Tried on like this, but all give an error
aStru := { ;
{ 'DESC', 'C', 50, 0 }, ;
{ 'INTERPRET', 'C', 5000, 0 } }
dbCreate( cPath + 'DCSCRIPT.DBF', aStru, 'DBFNTX' )
Does not like the array set up. I must be missing something. I would rather create a loop on an array. to create the fields
'DATA'+strzero(n,3) where n is the next field up to 110. But I cannot get by the array structure(?)
Any suggestions is appreciated.
Thanks
Fred
Omni