🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOConnection->OpenSchema

#951
From: Viatcheslav V. Vassiliev
Date: Sun, 13 Feb 2005 09:50
121 lines
4560 bytes
OpenSchema(siProcedures, ...)

Restriction columns are: PROCEDURE_CATALOG, PROCEDURE_SCHEMA, 
PROCEDURE_NAME, PROCEDURE_TYPE - prepare Array according this or pass 
EmptyParam to get all procedures.

//------------------------------------------
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:420e693b$1@newsgroups.borland.com...
> 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: <420f22c9$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41eedac8@newsgroups.borland.com> <41ef8bb7$1@newsgroups.borland.com> <420e693b$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: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <41eedac8@newsgroups.borland.com> <41ef8bb7$1@newsgroups.borland.com> <420e693b$1@newsgroups.borland.com>
Subject: Re: TADOConnection->OpenSchema
Date: Sun, 13 Feb 2005 12:50:02 +0300
Lines: 123
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 85.93.136.249
Message-ID: <420f22c9$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1108288201 85.93.136.249 (13 Feb 2005 01:50:01 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail