Article View: borland.public.cppbuilder.database.ado
Article #2381Re: How to create an ADO Dataset and TABLE via C++ code
From: Viatcheslav V. Vassiliev
Date: Fri, 04 Jul 2003 15:54
Date: Fri, 04 Jul 2003 15:54
61 lines
2573 bytes
2573 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);
}
}
"Steve" <sdardari@_NOSPAM_rimini.com> �������/�������� � �������� ���������:
news:3f058fa2@newsgroups.borland.com...
> Hi all,
> I want to use ADO to develop a little database application, just to try
and
> make some experience with ADO.
>
> I use C++ Builder Professional 6.
>
> I've created an Access "mdb" database file and a little VCL application
that
> make me use this database, via ADODataSet, ADOTable and so on. This work
all
> ok.
>
> But now I want to create a new mdb file inside the application, and not
via
> Access.
>
> How this can be done ?
>
> I've to use ADODataSet->FieldDefs definitions to setting up all the
filelds
> (like BDE style?)
> But ther's not the CreateTable method in the ADOTable ...
>
> Or I've to use the ADOCommand component and use an SQL statement?
> And in this case, there are some samples?
>
> Thanks in advance,
> Steve
>
>
Technical Details
Message-ID:
<3f05c08d@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f058fa2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,662d1f202f8afaa5 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-07-04 11:09:42 PST From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3f058fa2@newsgroups.borland.com> Subject: Re: How to create an ADO Dataset and TABLE via C++ code Date: Fri, 4 Jul 2003 19:54:05 +0400 Lines: 63 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: <3f05c08d@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1057341581 213.247.201.57 (4 Jul 2003 10:59:41 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail