Board index » delphi » Problems exporting a table (query) to a text file with TBatchMove

Problems exporting a table (query) to a text file with TBatchMove

I'm having problems exporting a TQuery to a text file using TBatchMove.
Everything works fine on most of the machines I've tried it on, but on
Windows 95/98 notebooks it seems to fail.  I call the Execute method and
it returns normal, yet the files are not there (the .sch file for
example).  I export three tables and it seems to fail on a random one,
but almost always fails.  I don't want to replace the BDE since I've
already released a beta version but I'm not sure if I have a choice.
I've searched DejaNews and can't find anyone having this problem.  I use
C++ Builder 1.0 which prevents me from using the latest tools.  I know
this is a Delphi newsgroup but since the components are the same I
thought maybe someone could help.

--
Mike / mike_n...@hotmail.com

 

Re:Problems exporting a table (query) to a text file with TBatchMove


Hi!

I'm having a similar problem while converting Data from an old Style DBASE
application. Iwrote the code by hand like this:

while not table1.eof do
begin
  try
    table1.field[i]:=table2.field[i]
  except
  end;
  try
    post;
  except
  end;
end;

(its not exactly what i wrote (syntax) but I think you know what I mean)
Regardless of any errors the programcode will run and post -if possible- the
code.
The main Prob: It's awfull slow and the network traffic is extreme high.

(But I can't use TBatchmove it always terminates with errors and doesn't put
all datasets in the new database)

Andre

Quote
"Mr. Mike" wrote:
> I'm having problems exporting a TQuery to a text file using TBatchMove.
> Everything works fine on most of the machines I've tried it on, but on
> Windows 95/98 notebooks it seems to fail.  I call the Execute method and
> it returns normal, yet the files are not there (the .sch file for
> example).  I export three tables and it seems to fail on a random one,
> but almost always fails.  I don't want to replace the BDE since I've
> already released a beta version but I'm not sure if I have a choice.
> I've searched DejaNews and can't find anyone having this problem.  I use
> C++ Builder 1.0 which prevents me from using the latest tools.  I know
> this is a Delphi newsgroup but since the components are the same I
> thought maybe someone could help.

> --
> Mike / mike_n...@hotmail.com

Re:Problems exporting a table (query) to a text file with TBatchMove


Quote
>Everything works fine on most of the machines I've tried it on, but on
>Windows 95/98 notebooks it seems to fail.

If it is just notebooks it may be a problem with Windows having insufficient
free space.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Problems exporting a table (query) to a text file with TBatchMove


Quote
> >Everything works fine on most of the machines I've tried it on, but on
> >Windows 95/98 notebooks it seems to fail.

> If it is just notebooks it may be a problem with Windows having insufficient
> free space.

I think maybe it's processor speed.  My notebook has a Pentium 200 with
32 megs of ram, and 1 gig hard drive space, so I think I have that
covered.

--
Mike / mike_n...@hotmail.com

Re:Problems exporting a table (query) to a text file with TBatchMove


Quote
> I'm having problems exporting a TQuery to a text file using TBatchMove.
> Everything works fine on most of the machines I've tried it on, but on
> Windows 95/98 notebooks it seems to fail.  I call the Execute method and
> it returns normal, yet the files are not there (the .sch file for
> example).  I export three tables and it seems to fail on a random one,
> but almost always fails.  I don't want to replace the BDE since I've
> already released a beta version but I'm not sure if I have a choice.
> I've searched DejaNews and can't find anyone having this problem.  I use
> C++ Builder 1.0 which prevents me from using the latest tools.  I know
> this is a Delphi newsgroup but since the components are the same I
> thought maybe someone could help.

I think I've figured it out.  After doing the batchmove, I was doing a
loop with ProcessMessages() and Sleep(1000) to look for the files every
second and break the loop when they appear.  After a while (20 seconds)
I give up.  Well the missing .sch file always appears when I display the
message box saying I give up!  So I think the problem is my loop was
holding up the event loop - for some reason the ProcessMessages isn't
emptying it out.  So I think I need to use threads, but that will
totally change the design of that part of my program.  

If anyone knows another way I'd be very interested in more info.

Thanks,
Mike

Other Threads