Article View: borland.public.cppbuilder.database.ado
Article #1970Re: Creating MS Access Database (revisited)
From: Pat
Date: Thu, 08 Jan 2004 11:24
Date: Thu, 08 Jan 2004 11:24
35 lines
2308 bytes
2308 bytes
Hi,
looking the past posts I learned how I can create a new linked-table in
an existing MS Access database, using ADO components and SQL commands.
Now I'm trying to understand how I can create a new MS Access database,
so could you please explaine better the source code you post?
> 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();
In strConnectionString I put yhe following:
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Dource=db.mdb;Mode=ReadWrite|Share Deny None";
but BCB6 give me a memory error when I run the program, even if it
create the MS Access database.
What's the meaning of
> CoInitializeEx(NULL, COINIT_MULTITHREADED);
because I don't found anything about it in the BCB6 guide.
Thanks for the answer.
Pat
--
remove AGR for reply
Technical Details
Message-ID:
<v5bLb.239314$e6.9476565@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-08 03:24:13 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: 36 Message-ID: <v5bLb.239314$e6.9476565@twister2.libero.it> Date: Thu, 08 Jan 2004 11:24:11 GMT NNTP-Posting-Host: 62.98.120.217 X-Complaints-To: abuse@inwind.it X-Trace: twister2.libero.it 1073561051 62.98.120.217 (Thu, 08 Jan 2004 12:24:11 MET) NNTP-Posting-Date: Thu, 08 Jan 2004 12:24:11 MET Organization: [Infostrada]