CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Posts
    1

    Export recordset to ASCII file

    Hi there,
    How can I export recordset data to ASCII file using VB code? I'm looking for the same effect as "DoCmd.TransferText acExportDelim......" has in Access?
    Thanks


  2. #2
    Join Date
    Aug 2000
    Location
    Ottawa, Canada
    Posts
    469

    Re: Export recordset to ASCII file

    You can do it manually: in a loop read all values of your recordset and write those into the text file.


  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Export recordset to ASCII file

    1.Create a recordset
    2.Write records to the text file


    Open "c:\temp\temp.txt" For Output As #1 'to write to

    rs.movefirst
    do while not rs.eof
    Print #1, rs!Field1 & vbTab & rs!Field2 & etc...
    rs.movenext
    loop
    Close #1


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured