🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADO example

#2579
From: Viatcheslav V. Vassiliev
Date: Wed, 16 Apr 2003 09:39
92 lines
4097 bytes
>my dbf is ODBC compatible?
If you open it with OLEDB provider for ODBC - yes. I think all dbf are ODBC
compatible. You may also use MS Jet (MS Access, Microsoft.Jet.OLEDB.4.0)
OLEDB provider to work with dbf files.

> And I dont know how to create Acces file or other.
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.

"Rato" <patrickartaud@csi.com> �������/�������� � �������� ���������:
news:3e9cf5c9$1@newsgroups.borland.com...
> Thank you very much
> I have done it and it si ok
> I open a dbf file with your example and now can I say my dbf is ODBC
> ompatible?
> It is because I must use Prolog language with BCB and Prolog read only
ODBC
> databases and all the databases build by my application are dbf files!!
> And I dont know how to create Acces file or other.
> Thank you again very much
> Patrick
>
> "Viatcheslav V. Vassiliev" <support@oledbdirect.com> a �crit dans le
message
> de news: 3e9a46cb$1@newsgroups.borland.com...
> > 1. Place TADOConnection on the form.
> > 2. Set ConnectionString property to valid connection string.
> > 3. Set Connected = true.
> > 4. Place TADOTable on the form.
> > 5. Set Connection property to ADOConnection1.
> > 6. Set TableName property.
> > 7. Set Active property.
> > 8. Add TDataSource and set DataSet property to ADOTable1.
> > 9. Add TDBGrid and set DataSource property to DataSource1.
> >
> > ----------------------------------------------------------------
> > 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.
> >
> > "Rato" <patrickartaud@csi.com> �������/�������� � �������� ���������:
> > news:3e98557b@newsgroups.borland.com...
> > > Hello,
> > > Where could I find example about creating a table at running time and
> > > display it in a grid?
> > > I use BCB6
> > > I know make it with TTable etc....But I don't understand how to use
TADO
> I
> > > have read the Borland book, but...
> > > I thank you in advance
> > >
> > > Patrick
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID: <3e9d27a9@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!64.152.100.70.MISMATCH!sjc70.webusenet.com!c03.atl99!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3e98557b@newsgroups.borland.com> <3e9a46cb$1@newsgroups.borland.com> <3e9cf5c9$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,1de71d8265b16666
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-04-16 02:58:08 PST
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3e98557b@newsgroups.borland.com> <3e9a46cb$1@newsgroups.borland.com> <3e9cf5c9$1@newsgroups.borland.com>
Subject: Re: TADO example
Date: Wed, 16 Apr 2003 13:39:21 +0400
Lines: 94
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: <3e9d27a9@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1050486697 213.247.201.57 (16 Apr 2003 02:51:37 -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!64.152.100.70.MISMATCH!sjc70.webusenet.com!c03.atl99!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail