Article View: borland.public.cppbuilder.database.multi-tier
Article #1106Re: Copying *.DBF files
From: Dirk Schwammkrug
Date: Tue, 25 Apr 2000 00:00
Date: Tue, 25 Apr 2000 00:00
96 lines
4771 bytes
4771 bytes
Hi Brian,
> that program interacts with other parts of our system. I
> need to emulate the original programmer's output exactly.
now I see clearer. You could try it anyway, despite that
constraint. If the other parts of your system talk to the
database in "dbase" language, they won't mind the additional
fields in the record structure. I once wrote an application
that had to operate in parallel to a CLIPPER based DOS
application on the same DBASE III+ tables and it worked for me.
best regards,
Dirk
Brian Phillips wrote:
>
> Hi Dirk;
> I understand your concern about copying the index
> and memo files connected to the original file. Thank you.
> I also understand your recommendation of changing
> the database structure but I do not have that choice. I
> am replacing an existing DOS based program. The output of
> that program interacts with other parts of our system. I
> need to emulate the original programmer's output exactly.
> So that means for every date the program runs I need to
> create two new database files and populate them. I can't
> seem to create two new database files without them being
> corrupt.
> Thank you or anyone else who can help.
> Brian
> ------------------------------------------------------------
> Dirk Schwammkrug wrote:
> 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
> ------------------------------------------------------------
--
_________________________________________________
Dirk Schwammkrug
Computer Scientist R & D
Chemspeed Ltd, CH-Augst, http:\\www.chemspeed.com
Phone: (+41)61-8169-640 Fax: [..]-509
Technical Details
Message-ID:
<39055C74.47991374@gmx.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<38FE3A47.2FAA@csc.sctboces.org> <38FEDE15.EA2B6CD1@gmx.net> <38FF25E4.328F@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/25 Message-ID: <39055C74.47991374@gmx.net> X-Deja-AN: 615388047 Content-Transfer-Encoding: 7bit References: <38FE3A47.2FAA@csc.sctboces.org> <38FEDE15.EA2B6CD1@gmx.net> <38FF25E4.328F@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