Article View: borland.public.cppbuilder.database.ado
Article #1569Re: TADOConnection::OpenSchema question
From: Arnie Mauer
Date: Tue, 18 May 2004 17:46
Date: Tue, 18 May 2004 17:46
77 lines
3434 bytes
3434 bytes
Thanks again Viatcheslav. In addition to just getting the user tables now,
the duplicate table names in Oracle are gone.
- Arnie
"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:40aa44e8@newsgroups.borland.com...
> I now have no Oracle near so example is for MS SQL Server, but it should
> work for other DBMS. This sample shows only user tables.
>
>
> void __fastcall TForm1::Button1Click(TObject *Sender)
> {
> ADOConnection1->ConnectionString = WideString("Provider=SQLOLEDB;"
> "Integrated security=SSPI;Initial catalog=pubs");
> ADOConnection1->Connected = true;
>
> OleVariant EmptyParam;
> EmptyParam.VType = VT_ERROR;
> EmptyParam.VError = DISP_E_PARAMNOTFOUND;
>
> SAFEARRAY FAR* psa = NULL;
> SAFEARRAYBOUND rgsabound;
> OleVariant var;
> OleVariant Array;
> rgsabound.lLbound = 0;
> rgsabound.cElements = 4;
>
> psa = SafeArrayCreate(VT_VARIANT, 1, &rgsabound);
> var.VType = VT_EMPTY;
>
> long ix;
> ix = 0;
> SafeArrayPutElement(psa, &ix, &var);
>
> ix = 1;
> SafeArrayPutElement(psa, &ix, &var);
>
> ix = 2;
> SafeArrayPutElement(psa, &ix, &var);
>
> var.VType = VT_BSTR;
> var.VOleStr = WideString("TABLE"); //Look possible values in TABLE_TYPE
> column
> //when there is no restrictions
> ix = 3;
> SafeArrayPutElement(psa, &ix, &var);
>
> Array.VType = VT_ARRAY | VT_VARIANT;
> Array.VArray = (TVarArray*)psa;
>
> ADOConnection1->OpenSchema(siTables, Array, EmptyParam, ADODataSet1);
> }
>
> //------------------------------------------
> 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)
>
>
> "Arnie Mauer" <xxx@nowhere.net> �������/�������� � �������� ���������:
> news:40aa00ec@newsgroups.borland.com...
> > Thanks Vassiliev,
> >
> > That works - sort of. Actually it works fine for DB2 and SQL Server.
> But,
> > with Oracle 9i, I seem to be getting some duplicate table names as well
as
> > system tables. Any ideas on the dups or getting rid of the system
tables?
> >
> > Thanks,
> > - Arnie
> >
Technical Details
Message-ID:
<40aa4c2b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!prodigy.com!atl-c02.usenetserver.com!c03.atl99!c01.usenetserver.com!news.usenetserver.com!elnk-atl-nf1!newsfeed.earthlink.net!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40a8f814$1@newsgroups.borland.com> <40a9e424@newsgroups.borland.com> <40aa00ec@newsgroups.borland.com> <40aa44e8@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,9e7f498881b02be9 X-Google-Attributes: gid10698b,public From: "Arnie Mauer" <xxx@nowhere.net> Newsgroups: borland.public.cppbuilder.database.ado References: <40a8f814$1@newsgroups.borland.com> <40a9e424@newsgroups.borland.com> <40aa00ec@newsgroups.borland.com> <40aa44e8@newsgroups.borland.com> Subject: Re: TADOConnection::OpenSchema question Date: Tue, 18 May 2004 13:46:39 -0400 Lines: 80 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 209.140.211.97 Message-ID: <40aa4c2b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1084902443 209.140.211.97 (18 May 2004 10:47:23 -0700) Path: arc1-ca.pugleaf.net!controlnews3.google.com!news1.google.com!news.glorb.com!prodigy.com!atl-c02.usenetserver.com!c03.atl99!c01.usenetserver.com!news.usenetserver.com!elnk-atl-nf1!newsfeed.earthlink.net!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail