VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Saving ADO Recordset to a text file with user-defined requirements such as col/row delimiters is so

by Yuening Dai (30 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 12th September 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



'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

Download this snippet    Add to My Saved Code

Saving ADO Recordset to a text file with user-defined requirements such as col/row delimiters is so Comments

No comments have been posted about Saving ADO Recordset to a text file with user-defined requirements such as col/row delimiters is so. Why not be the first to post a comment about Saving ADO Recordset to a text file with user-defined requirements such as col/row delimiters is so.

Post your comment

Subject:
Message:
0/1000 characters