This Snip uses a Recordset, and creates an Excel CSV file without having, or referencing Excel, or
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
(1(1 Vote))
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
This Snip uses a Recordset, and creates an Excel CSV file without having, or referencing Excel, or Comments
No comments yet — be the first to post one!
Post a Comment