Board index » delphi » structure modification of DBase file

structure modification of DBase file

I have to write a program that does a structure modification on a DBase
database, because the new version of our application requieres so new fields
and fields structure modifications?

What is the best (and easiest) way to realize this?

Stefan

 

Re:structure modification of DBase file


The easiest way is to use a TQuery and the SQL ALTER TABLE statement if it
will do what you need.  The alternative is to use the BDE API function
DbiDoRestructure.  See the examples at
www.inprise.com/devsupport/bde/bdeapiex.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:structure modification of DBase file


One other idea would be to:

- rename the current table
- create a new table with the new structure
- move the data from the current table to the new table

just for safety sake.

Quote
Stefan Schaffner wrote:
> I have to write a program that does a structure modification on a DBase
> database, because the new version of our application requieres so new fields
> and fields structure modifications?

> What is the best (and easiest) way to realize this?

> Stefan

Re:structure modification of DBase file


In article <6onhuj$a...@forums.borland.com>,
  "Stefan Schaffner" <schaff...@asis.net> wrote:

Quote
> I have to write a program that does a structure modification on a DBase
> database, because the new version of our application requieres so new fields
> and fields structure modifications?

> What is the best (and easiest) way to realize this?

> Stefan

Create a new DBase file with the field structures as you require then write
an application that copys the contents of each field from the old database to
the new field in the new database.

ie replace dbf2->field1 with dbf1->field1, dbf2->field2 with dbf1->field2 etc

Regards Steve D (New Zealand)

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Other Threads