Article View: borland.public.cppbuilder.database.ado
Article #109Re: retrieving schema information with ADO
From: Vassiliev V. V.
Date: Wed, 29 Aug 2007 20:04
Date: Wed, 29 Aug 2007 20:04
64 lines
3207 bytes
3207 bytes
TADODataSet that is passed to OpenSchema should be initialized and EmptyParam should be instead of NULL: OleVariant EmptyParam; EmptyParam.VType = VT_ERROR; EmptyParam.VError = DISP_E_PARAMNOTFOUND; TADODataSet * DS = new TADODataSet(this); Conn->OpenSchema(siColumns, EmptyParam, EmptyParam, DS); //do not forget to free DS //------------------------------------------ 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) "Mike K" <nospam@nospam.net> ???????/???????? ? ???????? ?????????: news:46d46ae6$1@newsgroups.borland.com... > Sorry to need the handholding, but this code: > > TADODataSet *DS; > Conn->OpenSchema(siColumns,NULL,NULL,DS); > > returns the error: "arguments are of the wrong type, are out of acceptable > range, or are in conflict with one another." > > I see that at design time I can open a dataset with a SELECT * query and > then have access to FieldDefs, which gives me the field data I need. How > do I get this data at runtime? I see GetIndexDefs() as a method, but > nothing for FieldDefs. > > > > > Vassiliev V. V. wrote: >> Look at TADOConnection::OpenSchema(). You need schema siColumns. >> >> //------------------------------------------ >> 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) >> >> >> "Mike K" <nospam@nospam.net> ???????/???????? ? ???????? ?????????: >> news:46d3828b$1@newsgroups.borland.com... >>> I'm building a database converter that needs to know the field data >>> types for every table. >>> >>> How is this done? I can use GetTableNames() and GetFieldNames() but I >>> still need the data types for each field. >>> >>> (Using BCB 5) >>> >>> thanks for any help... >>> >>
Technical Details
Message-ID:
<46d5d16c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!194.134.4.77.MISMATCH!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<46d3828b$1@newsgroups.borland.com> <46d3d886@newsgroups.borland.com> <46d46ae6$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,c1d0acbe2fb5d61 X-Google-Attributes: gid10698b,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Vassiliev V. V." <support@oledbdirect.com> Newsgroups: borland.public.cppbuilder.database.ado References: <46d3828b$1@newsgroups.borland.com> <46d3d886@newsgroups.borland.com> <46d46ae6$1@newsgroups.borland.com> Subject: Re: retrieving schema information with ADO Date: Thu, 30 Aug 2007 00:04:28 +0400 Lines: 65 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Response X-Antivirus: avast! (VPS 000769-2, 29.08.2007), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 85.93.138.132 Message-ID: <46d5d16c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1188417900 85.93.138.132 (29 Aug 2007 13:05:00 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!194.134.4.77.MISMATCH!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail