🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #2732

Connecting to an Access DB from a DLL

#2732
From: Ivo Karindi
Date: Wed, 26 Mar 2003 09:09
63 lines
2912 bytes
Win2k, BC++ Builder Pro 4.0, MS Access 2k



I need to connect to a MS Access db from a DLL that is called by other
software (Omega Research's Trade Station).  The DLL has to connect to the DB
and run a very elementary select SQL statement to retrieve a value from
there.  When I compile this project as an independent *.exe, everything
works fine.  However, in the DLL form, it looks like either the TTable or
TQuery components don't close the database connections, but leave things
"hanging" so Trade Station crashes.  My question is how do I close
everything down so that this will not happen?



Detailed description of what I do:



1) Trade Station calls the DLL

2) the DLL function call activates a form, opens TTable and TQuery, and
enters a date value into an edit box.

3) a simple SQL statement is run (using TQuery) to retrieve a value from the
database corresponding to that date.

4) the value is inserted into a DBEdit box and reported by the DLL function
back to Trade Station.

5) The form that was activated is closed, also TTable and TQuery are closed.

6) Checking things from Trade Station it is clear that correct values have
been retrieved from the database.  However, I can not do *anything* with
Trade Station anymore as it's hanging and mouse cursor has turned into the
tiny hourglass with the letters "SQL" next to it.



Now I probably don't necessarily need to open a form in order to run the SQL
statement, but so far I simply haven't gotten any other methods to work yet.



TIA for any suggestions,



Ivo





PS it's probably clear that I'm doing my very first steps in database
programming...



PPS Also if there are any good references on the 'net, please point me to
them.  Book recommendations would be helpful as well except the fact that it
will take time to order from Amazon and I haven't found anything so specific
locally.
Technical Details
Message-ID: <3e816e4e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,563a793073c36eb2,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-03-26 01:10:59 PST
Reply-To: "Ivo Karindi" <solk@ieslc.com>
From: "Ivo Karindi" <solk@ieslc.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Connecting to an Access DB from a DLL
Date: Wed, 26 Mar 2003 11:09:03 +0200
Lines: 65
Organization: IESLC
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 213.35.136.182
Message-ID: <3e816e4e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1048669774 213.35.136.182 (26 Mar 2003 01:09:34 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail