Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Recordset field to text file (2000)

    Is there an easy way to select a field in a recordset (probably of memo type) and export it to a text file? I vaguely recall something about exporting an entire ADO recordset as text but cannot find any instructions.

    Ian

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Recordset field to text file (2000)

    There is the Recordset.Save method, but your choice of formats may not be what you want.

    You could use the old (Visual) Basic Open, Print/Write, Close statements or the newer (Microsoft Scripting Runtime) FileSystemObject methods. I believe both can handle your field as text or binary data.

    ADO also has a Stream object but I haven't used it and have no idea whether it makes sense to use that to write a simple file.

    Afterthought: Forgot about the GetString method, to create a delimited string containing one or more records.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Recordset field to text file (2000)

    Are you trying to export a single value or just one field of values? In either case, it's far easier to create a query that only contains that field (and with criteria to specify a particular record if necessary) and then export the query.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •