🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

How to new an ADOConnection at run time?

#1668
From: Patrick Wong
Date: Wed, 24 Mar 2004 06:45
19 lines
1439 bytes
Dear all,

I want to use ADO for MSSQL access in a Console application.

When I try to "new" a TADOConnection at run-time an exception is raised:

"Error in EOleSysError with message: CoInitialize has not been called"

Am I missing something?  I am using BCB5.  The on-line help instructs:

"Pass a window handle as a parameter to embed the ADO connection in a
non-VCL window..."

But I don't quite understand what does that mean.

Please kindly advise how to proceed.

Many thanks,
Patrick.
Technical Details
Message-ID: <40612e87@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!newshosting.com!nx01.iad01.newshosting.com!203.109.252.33.MISMATCH!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,921a3cbd4e1b3c9c,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2004-03-23 22:47:49 PST
From: "Patrick Wong" <patrickwong@computer.org>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: How to new an ADOConnection at run time?
Date: Wed, 24 Mar 2004 14:45:42 +0800
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 203.82.252.252
Message-ID: <40612e87@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1080110727 203.82.252.252 (23 Mar 2004 22:45:27 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!nx01.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail