🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Creating MS Access Database (revisited)

#1960
From: Viatcheslav V. Vassiliev
Date: Wed, 07 Jan 2004 11:10
42 lines
2400 bytes
No. If Connection will go out of scope, no close/release are called and no
methods will be available (may be instead of Release). Release is called
automatically by Variant destructor.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Simon Elliott" <simon@nospam.demon.co.uk> �������/�������� � ��������
���������: news:l7kM7DARmf+$IwaV@courtlands.demon.co.uk...
> (Reposted in case anyone missed it due to the Christmas/New Year break)
>
> I'm creating an MS Access database with:
>
> Variant Catalog;
> Variant Connection;
> CoInitializeEx(NULL, COINIT_MULTITHREADED);
> Catalog=Variant::CreateObject("ADOX.Catalog");
> Catalog.Exec(Function("Create") << strConnectionString);
> Connection = Catalog.Exec(PropertyGet("ActiveConnection"));
> ...
> Connection.Exec(Function("Close"));
> CoUninitialize();
>
> Do I need to do anything special to close/release Catalog and
> Connection?
>
> What happens if Catalog and Connection go out of scope after the
> CoUninitialize() call? Will this mean that an implicit close/release
> happens after CoUninitialize(), and if so, will this cause problems?
> -- 
> Simon Elliott
> http://www.ctsn.co.uk/
>
>
>
>
>
>
Technical Details
Message-ID: <3ffbe968$2@newsgroups.borland.com>
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!not-for-mail
References: <l7kM7DARmf+$IwaV@courtlands.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,ff958fa036e0aba6
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2004-01-07 03:39:38 PST
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <l7kM7DARmf+$IwaV@courtlands.demon.co.uk>
Subject: Re: Creating MS Access Database (revisited)
Date: Wed, 7 Jan 2004 14:10:54 +0300
Lines: 44
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: 213.234.218.42
Message-ID: <3ffbe968$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1073473896 213.234.218.42 (7 Jan 2004 03:11:36 -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!not-for-mail