🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOConnection->OpenSchema

#950
From: Leen Keus
Date: Sat, 12 Feb 2005 20:38
103 lines
3665 bytes
Thanks,

For other interest people. To get only informatie of one table, change the
SafeArray:

var.VType = VT_EMPTY;
long ix;
ix = 0;
SafeArrayPutElement(psa, &ix, &var);
ix = 1;
SafeArrayPutElement(psa, &ix, &var);
var.VType = VT_BSTR;
var.VOleStr = WideString(TableName); // Enter an AnsiString TableName
ix = 2;
SafeArrayPutElement(psa, &ix, &var);
var.VType = VT_EMPTY;
ix = 3;
SafeArrayPutElement(psa, &ix, &var);


The OpenSchema statement must be:
ADOConnection1->OpenSchema(siColumns, Array, EmptyParam, ADODataSet1);


I am now trying to found out how to get Stored Procedure information. Can
one help?


"Viatcheslav V. Vassiliev" <support@oledbdirect.com> schreef in bericht 
news:41ef8bb7$1@newsgroups.borland.com...
> 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)
>
>
> "Leen Keus" <lj.keus@tiscali.nl> �������/�������� � �������� ���������:
> news:41eedac8@newsgroups.borland.com...
>> Hi,
>>
>> does anybody has an example on how to use 
>> TADOConnection->OpenSchema(const
>> TSchemaInfo, const OleVariant, const OleVariant, TADODataSet *).
>>
>> I must get table information (field names, types, etc) from an MSAccess
>> database.
>>
>> Thanks so far,
>> Leen Keus
>>
>> -- 
>> :wq!
>>
>>
>
> 
Technical Details
Message-ID: <420e693b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41eedac8@newsgroups.borland.com> <41ef8bb7$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,9b0b5c0c871b014c
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Leen Keus" <lj.keus@tiscali.nl>
Newsgroups: borland.public.cppbuilder.database.ado
References: <41eedac8@newsgroups.borland.com> <41ef8bb7$1@newsgroups.borland.com>
Subject: Re: TADOConnection->OpenSchema
Date: Sat, 12 Feb 2005 21:38:49 +0100
Lines: 105
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 84.81.87.146
Message-ID: <420e693b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1108240699 84.81.87.146 (12 Feb 2005 12:38:19 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail