Article View: borland.public.cppbuilder.database.ado
Article #2426Re: ADOAccess v.1.0 for MS Access files does not work in BCB 6.0
From: Viatcheslav V. Vassiliev
Date: Mon, 28 Jul 2003 09:28
Date: Mon, 28 Jul 2003 09:28
44 lines
2151 bytes
2151 bytes
Import ADOX tyle library (Project\Import type library in menu - "Microsoft
ADO Ext. 2.x for DDL and Security"). It is good to add "ADOX" to class names
(i.e. change TTable to TADOXTable etc.).
#include <ADOX_tlb.hpp>;
...
WideString dbName =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
ExtractFilePath(ParamStr(0)) + "test.mdb";
Adox_tlb::TCOM_Catalog cat = CoCatalog::Create();
cat->Create(dbName.c_bstr());
You may also need to add
#include <comobj.hpp>
namespace System
{
void __fastcall CheckSafecallResult(HRESULT hr)
{
OleCheck(hr);
}
}
----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server, MS Jet (MS Access)
and Interbase (through OLEDB) databases.
"Palmetzhofer Dietmar" <dietmar.palmetzhofer@boku.ac.at> �������/�������� �
�������� ���������: news:3f24e0b8@newsgroups.borland.com...
> When trying to create a database, I'll get an exception (Bad Variant
Type).
> Has anyone a fully functional Code of this demo?
> Thanks,
> Didi
>
>
Technical Details
Message-ID:
<3f252a20$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f24e0b8@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,9c63a71e5bf3c70e X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-07-28 07:10:30 PST From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3f24e0b8@newsgroups.borland.com> Subject: Re: ADOAccess v.1.0 for MS Access files does not work in BCB 6.0 Date: Mon, 28 Jul 2003 13:28:30 +0400 Lines: 46 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 213.247.201.57 Message-ID: <3f252a20$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1059400224 213.247.201.57 (28 Jul 2003 06:50:24 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail