Article View: borland.public.cppbuilder.database.ado
Article #1957Re: Creating MS Access Database (revisited)
From: Pat
Date: Wed, 07 Jan 2004 10:01
Date: Wed, 07 Jan 2004 10:01
41 lines
2500 bytes
2500 bytes
Hi,
looking the past posts I learned how can I create a new linked-table in
an existing MS Access database, using ADO components and SQL commands.
Now I'm trying to understand how can I create a new MS Access database,
so could you please explaine better the source code you use to create an
MS Access database?
I mean:
- which are the "#include"?
- what's the meaning of
...
CoInitializeEx(NULL, COINIT_MULTITHREADED);
...
because I don't found anything about it in the BCB6 guide.
- and what about strConnectionString?
Thanks for the answer.
Pat
Simon Elliott wrote:
> 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?
--
remove AGR for reply
Technical Details
Message-ID:
<5OQKb.236348$e6.9364132@twister2.libero.it>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!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mailReferences:
<DlNlsBA9AB8$Iwut@courtlands.demon.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,1386b963f53820e2 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2004-01-07 02:01:37 PST 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!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mail From: Pat <pat-rizioAGR@libero.it> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: it, en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: Creating MS Access Database (revisited) References: <DlNlsBA9AB8$Iwut@courtlands.demon.co.uk> In-Reply-To: <DlNlsBA9AB8$Iwut@courtlands.demon.co.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 42 Message-ID: <5OQKb.236348$e6.9364132@twister2.libero.it> Date: Wed, 07 Jan 2004 10:01:37 GMT NNTP-Posting-Host: 62.98.43.136 X-Complaints-To: abuse@inwind.it X-Trace: twister2.libero.it 1073469697 62.98.43.136 (Wed, 07 Jan 2004 11:01:37 MET) NNTP-Posting-Date: Wed, 07 Jan 2004 11:01:37 MET Organization: [Infostrada]