Article View: borland.public.cppbuilder.database.ado
Article #1134Re: TADOConnection->OpenSchema
From: Viatcheslav V. Vassiliev
Date: Thu, 20 Jan 2005 10:45
Date: Thu, 20 Jan 2005 10:45
70 lines
2696 bytes
2696 bytes
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:
<41ef8bb7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<41eedac8@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> Subject: Re: TADOConnection->OpenSchema Date: Thu, 20 Jan 2005 13:45:13 +0300 Lines: 72 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 217.73.240.115 Message-ID: <41ef8bb7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1106217911 217.73.240.115 (20 Jan 2005 02:45:11 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail