VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This Snip uses a Recordset, and creates an Excel CSV file without having, or referencing Excel, or

by Anthony Loera (7 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 17th August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This Snip uses a Recordset, and creates an Excel CSV file without having, or referencing Excel, or automation of any kind. Get a my package of

API Declarations


'I keep all my snipped code stored in a zip file here for when I travel.

Rate This Snip uses a Recordset, and creates an Excel CSV file without having, or referencing Excel, or




strTmp As String
Open strPath For Output As #1
RecordsetToCSV = False

Print #1, """"
Do Until rs.EOF
    ' shoots blocks of 100 rows for speed
    tmp = rs.GetString(, 100, """,""", """" & vbCrLf & """", "")
    If rs.EOF Then
        ' drop the extra double quoted character sent
        tmp = Left$(tmp, Len(tmp) - 1)
    End If
    Print #1, tmp;
Loop
RecordsetToCSV = True

End FunctionClose #1

Download this snippet    Add to My Saved Code

This Snip uses a Recordset, and creates an Excel CSV file without having, or referencing Excel, or Comments

No comments have been posted about This Snip uses a Recordset, and creates an Excel CSV file without having, or referencing Excel, or . Why not be the first to post a comment about This Snip uses a Recordset, and creates an Excel CSV file without having, or referencing Excel, or .

Post your comment

Subject:
Message:
0/1000 characters