🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.multi-tier
Article #1239

Re: Copying *.DBF files

#1239
From: Dirk Schwammkrug
Date: Thu, 20 Apr 2000 00:00
55 lines
3101 bytes
Hi Brian,

if the tables contain memo fields, you must copy the corresponding
*.DBT files also. Same applies for index files if you use any.

Despite that, why don't you just add a date field to the database
structure to hold the "editing date"? It would make queries simpler,
especially those of type "what did I edit last week?" when the date
your program requires is connected with the calendar. Just curious.
hope it helps,
Dirk


Brian Phillips wrote:
> 
> Hi;
> 
>         I'm using a *.DBF file to start with.  I am writing a program
> that creates two output database files for every date that the users
> enter when running the program. In other words - A user will open the
> program and have to enter a date on the screen before they can do any
> data entry or run any reports.  When the users enters a date into the
> program I use the date to create the name of the two database files.  If
> they do exists I will just activate the database files for user access.
> If they do not exist I will create them and then activate the database
> files for user access.
>         I'm currently using the DOS 'system' command to copy a blank database
> and assigning it the right new name.  Then I make the 'Ttable Active'
> property "false", renaming the 'TableName' property of the 'TTable', and
> finally I make the 'Ttable Active' property "true". Here is an example.
> 
> String date, NewFileNameI, NewFileNameII;
> date = DateFromTheUser->Text;
> Convert(date, NewFileNameI, NewFileNameII);
> system("copy C:\\BlankFileI.dbf  C:\\NewFileNameI.dbf");
> system("copy C:\\BlankFileII.dbf  C:\\NewFileNameII.dbf");
> ATable->Active = false;
> ATable->TableName = "NewFileNameI.dbf";
> ATable->Active = true;
> BTable->Active = false;
> BTable->TableName = "NewFileNameII.dbf";
> BTable->Active = true;
> 
>         I am able to open the new databases.  When I go to write records to
> these new files I receive errors letting me know that builder can not
> find certain fields within the database. It can find most of the fields
> but not all of them.  If I look at the new databases through other
> software I can see all the fields are there.
>         I'm happy to fix this problem working with my current code or I'm just
> as happy to trash it all for another solution that will work.  For
> anyone who could put me on a track that would lead to another answer I
> thank you now!!!
> 
>                           Brian
> ------------------------------------------------------------------------
Technical Details
Message-ID: <38FEDE15.EA2B6CD1@gmx.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <38FE3A47.2FAA@csc.sctboces.org>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd2b,e196898ec15db7fc
X-Google-Attributes: gidfcd2b,public
From: Dirk Schwammkrug <Dirk.Schwammkrug@gmx.net>
Subject: Re: Copying *.DBF files
Date: 2000/04/20
Message-ID: <38FEDE15.EA2B6CD1@gmx.net>
X-Deja-AN: 613526732
Content-Transfer-Encoding: 7bit
References: <38FE3A47.2FAA@csc.sctboces.org>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Chemspeed Ltd.
Mime-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.multi-tier