🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Creating MS Access Database (revisited)

#1972
From: Pat
Date: Thu, 08 Jan 2004 11:26
31 lines
2096 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
Technical Details
Message-ID: <3ffd3ee0@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!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-08 03:39:39 PST
Date: Thu, 08 Jan 2004 12:26:47 +0100
From: Pat <pat-rizio@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
NNTP-Posting-Host: 62.98.120.217
Message-ID: <3ffd3ee0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1073561312 62.98.120.217 (8 Jan 2004 03:28:32 -0700)
Lines: 32
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail