reate a database with one row
Jiyajijp
Forums
Hi Brian,
Is it possible to create a database with one row with blank/zero data with some column names.
Can we create a blank database using scripts.
Best Regards,
Jiyaji
Hi Brian,
Is it possible to create a database with one row with blank/zero data with some column names.
Can we create a blank database using scripts.
Best Regards,
Jiyaji
Hi Jiyaji,
Hi Jiyaji,
Yes it is possible and I have done it many times for different scripts as sometimes you have to start from scratch. If you look under the IDEAScript language browser under client look for NewDatabase. Here is the example they use, they first create a new table using Client.NewTableDef function. They then add on the fields using the AppendField, this is much like create a virtual field on a normal database. The next step is to commit (create) the new database giving it a name. Once the new database is created you can then start adding information to it, in this example they add one record. I have a tendancy to do this in two steps, to first have a function to create the new database and then a second function to add the information. I find it easier to follow as the adding information usually has other calculations in it. You then append each new record using the AppendRecord function. One thing is you need to close your database and reopen it to see any changes so I usually end the adding records with a db.close and then open it again. If you don't do this it will appear blank until you manually close it and open it. Here is the example script: