Subject How to move info from a CheckListBox into SQL statement?
Author Chuck Belanger
Hi:

I'm a newbie to IB and IBO (and for that matter Delphi).

I'm trying to create a file maintenance utility that allows me to drop
or archive patient data from a medical device's database.

So far I've got a CheckListBox (from Delphi--I couldn't find an IBO
version of it) which uses a result from a simple query for all the
existing patients. I can select which patients to drop (BTW, there are
multiple related tables/rows that need to be dropped, too.)

What I want to do next is use the checked status to modify a DELETE or
combination SELECT & INSERT into archive table. I've tried a number of
things based on past experience in FoxPro without much success.

Could someone please give me a direction to go with this problem?

I did try to CREATE TABLE (temp table of selected patients to drop) in a
SCRIPT component but I wanted to use a WHENEVER statement to bypass any
possibility of already having a temp table which I would make from the
CheckListBox information. On Execution, the Script did not recognize
WHENEVER.

So how does one check for presence of a preexiting table? Would it be
better to just CREATE and DROP the table for each time I access the
utility?

What I originally tried was to use the query created and then modify it
based on the CheckListBox selection, but quickly saw that that didn't
work at all.

Why doesn't Script allow various IB statements?

Thank you for any help you can give,

Chuck Belanger, L.Ac.
(licensed acupuncturist)