Article View: borland.public.cppbuilder.database.ado
Article #1502Re: Create new database problem
From: Viatcheslav V. Vassiliev
Date: Fri, 23 Apr 2004 14:14
Date: Fri, 23 Apr 2004 14:14
68 lines
3017 bytes
3017 bytes
What is your IDE (BCB6, BCB5)? I will send you working example with imported
type library (I do import without creating VCL components).
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Martin Moeller" <martin.moeller@moema.it> �������/�������� � ��������
���������: news:4089186f@newsgroups.borland.com...
> Modified the code after importing the ADOX libray as suggetsed, but still
> can not create my first database.
> I get an exception for Widestring/variant conversion. It is:
>
> Project ... raised exception class EOleException with message
> '(this->Create(ConnectString, (VARIANT*)&Connection)) Error: 80040E17
> (-2147217897) @...
>
> The source is just:
>
> void __fastcall TForm1::Button1Click(TObject *Sender)
> {
>
> // if(CoInitialize(NULL)!=S_OK)
> Beep();
>
> WideString strConn="Provider=Microsoft.Jet.OLEDB.4.0; \
> Data Source=.\\New.mdb; \
> ";
>
> Adox_tlb::TCOM_Catalog cat = CoCatalog::Create();
> cat->Create(strConn.c_bstr());
>
>
> // CoUninitialize();
>
> }
>
> I also tried but get the same error using a catalog component placed on
the
> Form
>
> void __fastcall TForm1::Button1Click(TObject *Sender)
> {
>
> WideString strConn="Provider=Microsoft.Jet.OLEDB.4.0; \
> Data Source=.\\New.mdb; \
> ";
>
> AdoxCatalog1->Create(strConn.c_bstr());
>
> }
>
>
> while the suggested alternative returns a double declaration compiler
erros
>
> CatalogPtr cat2 = CoCatalog::Create();
> cat2->Create(strConn);
>
>
>
> Tks, Martin
>
>
Technical Details
Message-ID:
<408924bc@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4087d2f4@newsgroups.borland.com> <4087ef31$1@newsgroups.borland.com> <4087ff9c$1@newsgroups.borland.com> <40881473$1@newsgroups.borland.com> <40881b61$1@newsgroups.borland.com> <4089186f@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,270202afc138267d X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2004-04-23 07:31:25 PST From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <4087d2f4@newsgroups.borland.com> <4087ef31$1@newsgroups.borland.com> <4087ff9c$1@newsgroups.borland.com> <40881473$1@newsgroups.borland.com> <40881b61$1@newsgroups.borland.com> <4089186f@newsgroups.borland.com> Subject: Re: Create new database problem Date: Fri, 23 Apr 2004 18:14:22 +0400 Lines: 70 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 213.234.218.42 Message-ID: <408924bc@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1082729660 213.234.218.42 (23 Apr 2004 07:14:20 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!cyclone1.gnilink.net!gnilink.net!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail