🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: BCB6 Follow-up

#548
From: Viatcheslav V. Vassiliev
Date: Fri, 11 Nov 2005 20:18
62 lines
2955 bytes
Import ADOX type library and execute

//strConn is connection string.

  Adox_tlb::TCOM_Catalog cat = CoCatalog::Create();
  cat->Create(strConn.c_bstr());

or

  CatalogPtr cat = CoCatalog::Create();
  cat->Create(strConn);


You may also need to add (for C++ Builder 6)

#include <comobj.hpp>

namespace System
{
 void __fastcall CheckSafecallResult(HRESULT hr)
 {
  OleCheck(hr);
 }
}

All strings should be declared as WideString, not as AnsiString.

//------------------------------------------
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)


"poojo hackma" <poojo.com/mail> �������/�������� � �������� ���������: 
news:4374d7fa$1@newsgroups.borland.com...
> Follow-up:
>
> I've looked, and I have "Microsoft ADO Ext. 2.8 for DDL and Security 
> (Version 2.8)" listed among Project->Import Type Library members.  The 
> class names are TTable, TColumn, TIndex, TKey, TGroup, TUser, and 
> TCatalog.
>
> Several posts searching with 
> http://groups.google.com/group/borland.public.cppbuilder.database.ado/search?group=borland.public.cppbuilder.database.ado&q=create+database&qt_g=1 
> mention ways to create databases using TCatalog, but do not show any 
> examples.
>
> I tried:
>
> TCatalog cat;  // also tried TCOM_Catalog cat, but that didn't work 
> either.
> cat = CoCatalog::Create();
> cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\test.mdb");
>
> But that did not work because BCB6 did not know what either TCatalog nor 
> TCOM_Catalog were, and they were not listed in my Help files.  The closest 
> I got was something called TCOMAdminCatalog, but this does not look like 
> what I want.
> 
Technical Details
Message-ID: <4374fc8b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4374c751$1@newsgroups.borland.com> <4374d7fa$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,fd44f1fbb79ff20c
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <4374c751$1@newsgroups.borland.com> <4374d7fa$1@newsgroups.borland.com>
Subject: Re: BCB6 Follow-up
Date: Fri, 11 Nov 2005 23:18:54 +0300
Lines: 64
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 85.93.138.132
Message-ID: <4374fc8b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1131740299 85.93.138.132 (11 Nov 2005 12:18:19 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail