Saving ADO Recordset to a text file with user-defined requirements such as col/row delimiters is so
Saving ADO Recordset to a text file with user-defined requirements such as col/row delimiters is so easy now - use this function with only
Rate Saving ADO Recordset to a text file with user-defined requirements such as col/row delimiters is so
(2(2 Vote))
'function by setting some of those parameters to Optional to make it more
'flexible and meet your own need. I am just lazy.
Public Sub SaveRecInText(RstPrm As ADODB.Recordset, _
FileSpec As String, RowCount As Long, _
ColDeli As String, RowDeli As String, _
NullRep As String)
'
Dim sBuffer As String
Dim FileNum As Long
'
sBuffer = RstPrm.GetString(adClipString, RowCount, ColDeli, RowDeli, NullRep)
'
'Remove the file first if it exists.
If Len(Dir(FileSpec)) > 0 Then
Kill FileSpec
End If
'
FileNum = FreeFile
Open FileSpec For Binary As FileNum
Put FileNum, , sBuffer
Close FileNum
'
End Sub
Saving ADO Recordset to a text file with user-defined requirements such as col/row delimiters is so Comments
No comments yet — be the first to post one!
Post a Comment