🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TAdoConnection and OpenSchema

#442
From: Cabrera
Date: Tue, 07 Mar 2006 14:51
80 lines
3279 bytes
"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote:
>void __fastcall TForm1::Button1Click(TObject *Sender)
>{
> ADOConnection1->ConnectionString =
>WideString("Provider=Microsoft.Jet.OLEDB.4.0;"
>  "Data Source=c:\\temp\\test.mdb");
> 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)
>
>
>"Cabrera" <ivette.garrido@biesenbruc.de> �������/�������� � �������� 
>���������: news:440c3272$1@newsgroups.borland.com...
>>
>> I want to read all tables names and I write
>>     ....
>>      int bounds[] = {0,3};
>>       OleVariant A(bounds,1, varVariant);
>>       A.PutElement(varEmpty,0);
>>       A.PutElement(varEmpty,1);
>>       A.PutElement(varEmpty ,2);
>>       A.PutElement("TABLE",3);
>>
>>         m_cpConnection->OpenSchema(siTables,A,varEmpty,m_cpRecordset);
>>
>> m_cpConnection is derived from TAdoConnection and is activ
>> m_cpRecordset is als TAdoDataset declared, i use CBuilder6
>>
>> By attempting to run this code I receive a Exception (the Parameters are 
>> wrong .....
>>
>> How can I do???
>> Thanks 
>
>  Wonderfull!!!It's works fine
   Thanks X 100000000000000
Technical Details
Message-ID: <440dabe5$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <440c3272$1@newsgroups.borland.com> <440d4d60$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,c12374b23767ae55
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Cabrera" <ivette.garrido@biesenbruch.de>
Sender: "Cabrera" <ivette.garrido@biesenbruch.de>
Reply-To: "Cabrera" <ivette.garrido@biesenbruch.de>
Subject: Re: TAdoConnection and OpenSchema
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 82.207.220.231     
References: <440c3272$1@newsgroups.borland.com> <440d4d60$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <440dabe5$1@newsgroups.borland.com>
Date: 7 Mar 2006 07:51:01 -0700
X-Trace: newsgroups.borland.com 1141746661 207.105.83.66 (7 Mar 2006 07:51:01 -0700)
Lines: 81
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail