My question is this:
Is there a way to cycle through all the different fields in a record?
for example (Psuedo code here ).
Table1
Table2
while(!Table1->Eof)
{
c=Table1->FieldCount.
while(c>=1)
{
Table2.Field(c)=Table1.Field(c);
c++;
}
Table2->Post();
Table1->Next();
}
Thanks
Dwayne
What database are you using ? Oracle ?
If so there is a solution through a SQL command.
Jayme.
"Dwayne" <myfri...@yahoo.com> escreveu na mensagem
news:462901d9$1...@newsgroups.borland.com...
I am using Borland Builder 5 and Dbase for my files.
Dwayne
Jayme.
"Dwayne" <myfri...@yahoo.com> escreveu na mensagem
news:46311c34$1...@newsgroups.borland.com...
HTH
Jayme.
"Dwayne" <myfri...@yahoo.com> escreveu na mensagem
news:46311c34$1...@newsgroups.borland.com...
Hi Jayme
That's the reaon for the question
<Quote>
Since BatchMove is failing miserably on my large file, I am going to have
to transfer my data one record at a time.
</Quote>
;-)
I don't know if you've already solved your problem ?
Assuming the tables share the same structure you will be able to use the
pseudo code above.
something like (untested)
for ( int i = 0; i < Table1->FieldCount; i++ )
Table2->Fields->Fields[i] ->Assign(Table1->Fields->Fields[i]);
inside the table looping / Posting
HTH
Antonio
Jayme.
"Antonio Felix" <antoni...@maisspamnao.clixempt> escreveu na mensagem
news:4648d455$1...@newsgroups.borland.com...
Assuming the tables share the same structure you will be able to use the
pseudo code above.
something like (untested)
for ( int i = 0; i < Table1->FieldCount; i++ )
Table2->Fields->Fields[i] ->Assign(Table1->Fields->Fields[i]);
inside the table looping / Posting
Hello Antonio!
Long time no see!.. It is great to see and hear from you...
No, I have not solved my problem yet... I will attempt your way of doing
it.
I have used the Batch method for years, but I think it is limited on file
size, or Record numbers. it stopped working on me. So, I was working on
figuring a run-around way to solve my problem.
I have company records back to 1996, and they want to keep them... Right
now, I split up the files using Dbase (manually) and shrunk the later data
to make it work.
Dwayne
Same here.
Tell me if you need further help...
BR
Antonbio
I know you've been facing problems on using
the "Batch" method.
Have you considered using the TBatchMove
component instead of a TTable ?
This component has two datasets. One is the
TBatchMove::Destination, which must be a
TTable, the other is the TBatchMove::Source,
which can be also a TTable or a TQuery
because both are TBDEDataSet descendents .
Using a TQuery you can limit the number of
records and divide the amount of data to
transfer through the TBatchMove component.
Why don't you give it a try ? I've never used
them to handle so many records, so I'm not
an expert on this matter.
HTH.
Jayme.
"Dwayne" <myfri...@yahoo.com> escreveu na mensagem
news:4651fccd$1...@newsgroups.borland.com...
But.. I think what is happening, is the Index is messing up everything.
Sometimes it transfers everything, sometimes nothing. This could be with
the index.
Dwayne
First button:
AnsiString Buf1;
int i;
Form1->Table2->TableName="c:/customer/customer.dbf";
Form1->Table2->IndexName="c:/customer/customer.ndx";
Form1->Table2->Active=true;
Form1->Table2->StoreDefs=true;
Form1->Table2->Active=false;
Form1->Table2->TableName="c:/customer/junkjunk.dbf";
Form1->Table2->CreateTable();
Form1->Table2->Active=true;
Second Button:
int i;
Table1->First();
while(!Table1->Eof)
{
Table2->Append();
for ( int i = 0; i < Table1->FieldCount; i++ )
Table2->Fields->Fields[i] ->Assign(Table1->Fields->Fields[i]);
Table2->Post();
Table1->Next();
Form1->DBGrid2->Repaint(); (Attempt to Repaint the Grid... it was
worthess).
}
Hi Dwayne,
Have you tried to copy the Tables without the Index and after that run a
Create Index statement on Table2 ?
It should be easier using the natural order of the table.
The DBGrid is linked to Table2?
Why are you refreshing te grid on each record post?
To see the Grid repaint try to call Application->ProcessMessages just before
the Repaint call!
HTH
Antonio
> Have you tried to copy the Tables without the Index and after that run a
> Create Index statement on Table2 ?
> It should be easier using the natural order of the table.
I have tried, but I have yet to be able to make an index work on a
create. They always seem to fail on the DBASE program.
I do feel that the problem is lying in this new create table. with an
index though.
> The DBGrid is linked to Table2?
> Why are you refreshing te grid on each record post?
> To see the Grid repaint try to call Application->ProcessMessages just
> before the Repaint call!
I was trying to eliminate all possibilities, and see exactly what was
going on. I am doing this on a smaller sample data, so that I may be able
to experiment with it. The one thing that is sounding scary, is the
"delay" time if this thing should work <smile>. I sure would hate to copy a
lot of records...<SMILE>.
Dwayne