🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: copying Dataset into .txt file

#2050
From: Viatcheslav V. Vassiliev
Date: Fri, 21 Nov 2003 16:53
58 lines
2971 bytes
Use ADO recordset GetString method. Recordset is available from
TADODataSet.Recordset. Below there is description from MSDN:

GetString Method
Returns the Recordset as a string.

Syntax
Variant = recordset.GetString(StringFormat, NumRows, ColumnDelimiter,
RowDelimiter, NullExpr)Return Value
Returns the Recordset as a string-valued Variant (BSTR).

Parameters
  StringFormat
  A StringFormatEnum value that specifies how the Recordset should be
converted to a string. The RowDelimiter, ColumnDelimiter, and NullExpr
parameters are used only with a StringFormat of adClipString.
  NumRows
  Optional. The number of rows to be converted in the Recordset. If NumRows
is not specified, or if it is greater than the total number of rows in the
Recordset, then all the rows in the Recordset are converted.
  ColumnDelimiter
  Optional. A delimiter used between columns, if specified, otherwise the
TAB character.
  RowDelimiter
  Optional. A delimiter used between rows, if specified, otherwise the
CARRIAGE RETURN character.
  NullExpr
  Optional. An expression used in place of a null value, if specified,
otherwise the empty string.
Remarks
Row data, but no schema data, is saved to the string. Therefore, a Recordset
cannot be reopened using this string.

This method is equivalent to the RDO GetClipString method.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Ronan" <bhuvan.sharma@uwe.ac.uk> �������/�������� � �������� ���������:
news:3fbe214e@newsgroups.borland.com...
> Hi,
>
>  I am trying to copy all the values in a ADODataSet's colums to a .txt
file.
> Kindly help me how to do that.
>  Or if there is a direct way to do so, bypassing the requirement of
DataSet
> then please do tell.
>
> Many thanks,
> Ronan
>
>
>
Technical Details
Message-ID: <3fbe4385@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fbe214e@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,bcf3760d83b09629
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-11-21 09:11:08 PST
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3fbe214e@newsgroups.borland.com>
Subject: Re: copying Dataset into .txt file
Date: Fri, 21 Nov 2003 19:53:35 +0300
Lines: 61
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 213.234.218.42
Message-ID: <3fbe4385@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1069433733 213.234.218.42 (21 Nov 2003 08:55:33 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail