Article View: borland.public.cppbuilder.database.ado
Article #2326Re: List of Views of SQL Server with OpenSchema
From: Paulo Sérgio Tesche
Date: Thu, 21 Aug 2003 17:40
Date: Thu, 21 Aug 2003 17:40
73 lines
2722 bytes
2722 bytes
Thank you.
It works ....
Viatcheslav V. Vassiliev escreveu:
>Views schema is not supported by MS SQL Server. You should use tables schema
>with restrictions:
>
>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("VIEW"); //May be "SYSTEM VIEW"
>
> ix = 3;
> SafeArrayPutElement(psa, &ix, &var);
>
> Array.VType = VT_ARRAY | VT_VARIANT;
> Array.VArray = (TVarArray*)psa;
>
> ADOConnection1->OpenSchema(siTables, Array, EmptyParam, ADODataSet1);
>}
>
>"Paulo S�rgio Tesche" <ptesche@via-rs.net> ???????/???????? ? ????????
>?????????: news:3F427E87.8050309@via-rs.net...
>
>
>>Hi,
>>
>>Has anynone a code sample in C++ Builder to retrieve the list of views
>>of an SQL Server using TADOConnection and OpenSchema?
>>I�m stucked with the Variant types. How to create them, how to pass them
>>as parametes to OpenSchema?
>>
>>Any help greatle appreciated.
>>
>>Paulo Tesche
>>
>>
>>
>
>
>
>
Technical Details
Message-ID:
<3F45040D.5030100@via-rs.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3F427E87.8050309@via-rs.net> <3f4366d8@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,38216bdf85b92e32 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-08-21 10:36:06 PST Message-ID: <3F45040D.5030100@via-rs.net> Date: Thu, 21 Aug 2003 14:40:29 -0300 From: Paulo Sérgio Tesche <ptesche@via-rs.net> User-Agent: Mozilla/5.0 (Windows; U; Win98; pt-BR; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: pt-br, pt MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: List of Views of SQL Server with OpenSchema References: <3F427E87.8050309@via-rs.net> <3f4366d8@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 200.203.21.125 X-Trace: newsgroups.borland.com 1061486914 200.203.21.125 (21 Aug 2003 10:28:34 -0700) Lines: 74 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail