🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Creating MS Access Database (revisited)

#1959
From: Pat
Date: Wed, 07 Jan 2004 11:02
35 lines
2381 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: <0HRKb.232609$vO5.9593472@twister1.libero.it>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!nntp.infostrada.it!twister1.libero.it.POSTED!not-for-mail
References: <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 03:02:21 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!nntp.infostrada.it!twister1.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: <0HRKb.232609$vO5.9593472@twister1.libero.it>
Date: Wed, 07 Jan 2004 11:02:20 GMT
NNTP-Posting-Host: 62.98.60.243
X-Complaints-To: abuse@inwind.it
X-Trace: twister1.libero.it 1073473340 62.98.60.243 (Wed, 07 Jan 2004 12:02:20 MET)
NNTP-Posting-Date: Wed, 07 Jan 2004 12:02:20 MET
Organization: [Infostrada]