🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOQuery inside a TThread

#3329
From: Vassiliev V.V.
Date: Thu, 19 Sep 2002 22:10
64 lines
2926 bytes
CoInitilize() initializes COM in your thread. COM is required for ADO.

Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to work with MS SQL Server and MS Jet databases.

"Steve" <steve_alettoANTI@SPAMhotmail.com> �������/�������� � ��������
���������: news:3d89b904$1@newsgroups.borland.com...
> The problem is that the following line stops the thread!
>
> TADOQuery *MyQuery = new TADOQuery(NULL);
>
> It seems that since TADOQuery is not thread-safe I must use it in a
routine
> called by Synchronize(). But in this way the program is delayed because I
> use the VCL main thread to access the DB (open + query + close) and I
would
> like to avoid it...
>
> Any other suggestion? What is CoInitialize for?
>
> Thanks,
>
> Steve.
>
>
> Vassiliev V.V. <news@vassilievvv.mtu-net.ru> wrote in message
> 3d89b0db@newsgroups.borland.com...
> > What is the problem? You should call CoInitialize(NULL)/CoUninitialize
in
> > your thread.
> >
> > Regards,
> > Viatcheslav V. Vassiliev
> > http://www.oledbdirect.com
> > The fastest way to work with MS SQL Server and MS Jet databases.
> >
> > "Steve" <steve_alettoANTI@SPAMhotmail.com> �������/�������� � ��������
> > ���������: news:3d89874a@newsgroups.borland.com...
> > > Hi all,
> > >
> > > how can I use TADOQuery inside a TThread? Is it possible? I've already
> > tried
> > > something, but the thread locks itself when I use TADOQuery...
> > >
> > > For example the following line causes the problem (except if I put it
in
> > the
> > > thread constructor):
> > >
> > > TADOQuery *MyQuery = new TADOQuery(NULL);
> > >
> > > TIA,
> > >
> > > Steve.
> > >
> > >
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID: <3d8ade3a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!diablo.theplanet.net!newspeerenv1.svr.pol.co.uk!newsfeed.wirehub.nl!newsfeed.multikabel.nl!gatel-ffm!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3d89874a@newsgroups.borland.com> <3d89b0db@newsgroups.borland.com> <3d89b904$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,4e12a5ae0392282c
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-09-20 01:40:06 PST
From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3d89874a@newsgroups.borland.com> <3d89b0db@newsgroups.borland.com> <3d89b904$1@newsgroups.borland.com>
Subject: Re: TADOQuery inside a TThread
Date: Fri, 20 Sep 2002 02:10:38 +0400
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 62.118.128.240
Message-ID: <3d8ade3a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1032511034 62.118.128.240 (20 Sep 2002 01:37:14 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!diablo.theplanet.net!newspeerenv1.svr.pol.co.uk!newsfeed.wirehub.nl!newsfeed.multikabel.nl!gatel-ffm!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail