Article View: borland.public.cppbuilder.database.ado
Article #1955Creating MS Access Database (revisited)
From: Simon Elliott
Date: Mon, 05 Jan 2004 23:56
Date: Mon, 05 Jan 2004 23:56
23 lines
1712 bytes
1712 bytes
(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:
<l7kM7DARmf+$IwaV@courtlands.demon.co.uk>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!courtlands.demon.co.uk!simonShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,ff958fa036e0aba6,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2004-01-05 16:07:01 PST Message-ID: <l7kM7DARmf+$IwaV@courtlands.demon.co.uk> Date: Mon, 5 Jan 2004 23:56:01 +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: Creating MS Access Database (revisited) Lines: 29 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 1073346971 158.152.154.121 (5 Jan 2004 15:56:11 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!courtlands.demon.co.uk!simon