Board index » delphi » Help! - Non Visual Application Design

Help! - Non Visual Application Design

I have an application that I use to import data into a Paradox database from
a text file that usesTBatchMove. I access the text file with a TQuery via a
ODBC Text datasource, execute a Batch Copy to create a Paradox table , and
then do a Batch Append Update to append to the main table. I have this
working now, using OnClick events. However, I need this app to sit on a
server and not need someone there to click buttons. I tried reassigning the
OnCLick events to the form's OnCreate event, which does work , but still is
not usable for my purposes. I am trying to figure out how to have a non -
visual application that I can execute by scheduling, flag files, etc.
I think that the correct routefor me is either a Console app, or even an NT
Service app, but unfortunately I have no knowledge of either, an there is no
good documentation that I can find on these. Any suggestions and / or
experiance with this type of situation would be greatly appreciated.
 

Re:Help! - Non Visual Application Design


J Johnson skrev i meldingen <8atpeb$9e...@gaddy.interpath.net>...

Quote
>I have an application that I use to import data into a Paradox database from
>a text file that usesTBatchMove. I access the text file with a TQuery via a
>ODBC Text datasource, execute a Batch Copy to create a Paradox table , and
>then do a Batch Append Update to append to the main table. I have this
>working now, using OnClick events. However, I need this app to sit on a
>server and not need someone there to click buttons. I tried reassigning the
>OnCLick events to the form's OnCreate event, which does work , but still is
>not usable for my purposes. I am trying to figure out how to have a non -
>visual application that I can execute by scheduling, flag files, etc.
>I think that the correct routefor me is either a Console app, or even an NT
>Service app, but unfortunately I have no knowledge of either, an there is no
>good documentation that I can find on these. Any suggestions and / or
>experiance with this type of situation would be greatly appreciated.

Wouldn't a TTimer do ? Do some checking in the OnTimer event to see if
something is to be done (a new file existing, e.g.), and start your batch
operation from this event handler ?

--
Bjoerge Saether
Consultant / Developer
Asker, Norway
bsaether.removet...@online.no (remove the obvious)

Re:Help! - Non Visual Application Design


In article <8atpeb$9e...@gaddy.interpath.net>, J Johnson
(jjohn...@goldencorral.net) says...

Quote
> I am trying to figure out how to have a non -
> visual application that I can execute by scheduling, flag files, etc.

Create a console app.
Add a DataModule, put all your database stuff there.
Add a public method "Go" that contains the code of your original OnClick-
handler.
Instantiate the DataModule in the main program (between begin and end. in
the .DPR file (View->Project Sourc or Project->View source, depending on
Delphi version).
Call Go.
Free DataModule.

If you want, you can now reimplement the OnClick-thing (for testing or
whatever) by instantiating the datamodule and calling Go and Free in the
OnClick-handler. You've now successfully separated GUI from Buisiness
Logic and created a reusable object in the process (the datamodule). Very
good!!

Hope that helped. :*)

M.

--
ROOTS 2000, Bergen, April 27-28
{*word*19}burn, Coplien, Fowler, Groven, Reenskaug, Reich, Nygaard
Patterns, Use Cases, Refactoring, XP, UML, OO ++
http://roots.dnd.no

Other Threads