Article View: borland.public.cppbuilder.database.multi-tier
Article #1238Copying *.DBF files
From: Brian Phillips
Date: Wed, 19 Apr 2000 00:00
Date: Wed, 19 Apr 2000 00:00
40 lines
2515 bytes
2515 bytes
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:
<38FE3A47.2FAA@csc.sctboces.org>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,e196898ec15db7fc,start X-Google-Attributes: gidfcd2b,public From: Brian Phillips <bphillip@csc.sctboces.org> Subject: Copying *.DBF files Date: 2000/04/19 Message-ID: <38FE3A47.2FAA@csc.sctboces.org> X-Deja-AN: 613278519 Content-Transfer-Encoding: 7bit X-Trace: 19 Apr 2000 12:53:06 -0800, 216.42.90.67 Organization: SCT BOCES Content-Type: text/plain; charset=us-ascii MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.multi-tier