Article View: borland.public.cppbuilder.database.multi-tier
Article #771Re: Very slow database
From: Mark Vejvoda
Date: Thu, 30 Nov 2000 00:00
Date: Thu, 30 Nov 2000 00:00
65 lines
2241 bytes
2241 bytes
String fill
fstream FileA;
FileA.open(Mainform->OpenDialog->FileName.c_str(),ios::in);
if (bestand.is_open())
{
myDatabaseComponent.StartTransaction();
for(;;)
{
DataModule->Table->Insert();
DataModule->Table->FieldValues["some field"]=fill.c_str();
FileA >> fill.c_str()
// there are 18 fields that are loaded the same way
DataModule->Table->Post();
if(bestand.eof()) break;
}
myDatabaseComponent.Commit();
}
FileA.close();
"Martin Pennings" <mpennings@pentis.nl> wrote in message
news:3a260a0e_2@dnews...
> Thanks, but how do I do that?
>
> The following is the structure of my program:
>
>
> String fill
> fstream FileA;
> FileA.open(Mainform->OpenDialog->FileName.c_str(),ios::in);
>
> if (bestand.is_open())
> {
> for(;;)
> {
> DataModule->Table->Insert();
>
> DataModule->Table->FieldValues["some field"]=fill.c_str();
> FileA >> fill.c_str()
>
> // there are 18 fields that are loaded the same way
>
> DataModule->Table->Post();
> if(bestand.eof()) break;
> }
> }
>
> FileA.close();
>
> How can I put all this in one transaction?
>
>
>
> "Mark Vejvoda" <mvejvoda@soft-haus.com> schreef in bericht
> news:903ha9$jcd8@bornews.inprise.com...
> > Try doing it all in once transaction: StartTransaction... import the
file,
> > then Commit.
>
>
>
Technical Details
Message-ID:
<906ilt$d186@bornews.inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3a240af5_2@dnews> <903ha9$jcd8@bornews.inprise.com> <3a260a0e_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,d6f3644109147f18 X-Google-Attributes: gidfcd2b,public From: "Mark Vejvoda" <mvejvoda@soft-haus.com> Subject: Re: Very slow database Date: 2000/11/30 Message-ID: <906ilt$d186@bornews.inprise.com> X-Deja-AN: 699686034 References: <3a240af5_2@dnews> <903ha9$jcd8@bornews.inprise.com> <3a260a0e_2@dnews> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.cppbuilder.database.multi-tier