🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Are BCB6 ADO components threadsafe?

#2121
From: Simon Elliott
Date: Sat, 08 Nov 2003 09:17
18 lines
1718 bytes
Simon Elliott <simon@nospam.demon.co.uk> writes
>I have an application with lots of threads, each doing data acquisition.
>I want to put the data into an MS Access database using the BCB6 ADO
>components. 
>
>Are the ADO components threadsafe, or do I need to implement some kind
>of resource locking? 
>
>I expect I'd need a separate instance of TADOQuery or TADOTable
>components for each thread. Could I have a single TADOConnection or
>would I need a separate instance of this for each thread as well?

OK, found the answer to this. I need a TADOConnection for each thread,
plus a call to CoInitializeEx and CoUninitialize() at the beginning and
end of the thread function.
-- 
Simon Elliott
http://www.ctsn.co.uk/
Technical Details
Message-ID: <Qf0ByDAGTLr$IwWH@courtlands.demon.co.uk>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!courtlands.demon.co.uk!simon
References: <Q24R4AAwTCq$IwMv@courtlands.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,20d39133b18e82b8
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-11-08 01:39:04 PST
Message-ID: <Qf0ByDAGTLr$IwWH@courtlands.demon.co.uk>
Date: Sat, 8 Nov 2003 09:17:58 +0000
From: Simon Elliott <simon@nospam.demon.co.uk>
Reply-To: Simon Elliott <news@nospam.demon.co.uk>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Are BCB6 ADO components threadsafe?
References: <Q24R4AAwTCq$IwMv@courtlands.demon.co.uk>
Lines: 24
Organization: Courtlands Technical Services
MIME-Version: 1.0
X-Newsreader: Turnpike Integrated Version 4.02 U <aLIvuQCpEWZ0Tu7eytpxRhrSSE>
NNTP-Posting-Host: 158.152.154.121
X-Trace: newsgroups.borland.com 1068283488 158.152.154.121 (8 Nov 2003 01:24:48 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!courtlands.demon.co.uk!simon