• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

Read an entire ado recordset row?

Is there a way to read the entire recordset row in order to write to a file in one shot and add delimeters to the fields without looping through each field?
1 Solution
Naveen SwamyYash Infinite Solutions Private LimitedCommented:
getrows and getstring

check out there help and use it, it is far better than using/looping the rs objects
You could try incorporating DTS (Data Transformation Services) and Scripting.FileSystemObject, it's a bit long winded but it should work. Infact you could suck the whole recordset in as a DTSFlatFile and spit the lot out to you delimited text file.

Depending on how your retrieving your recordset? If its coming out of SQL using a stored Procedure it should be pretty easy.

check this out:

good point getrows would be A hell of a lot easier!!!!!!!!!!!!!
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

surfsista9Author Commented:
The recordset is coming out of sql. I'd like something that sucks the entire recordset into a file with the option to delimit fields and crlf at each record.

I'll check out DTSFlatFile.
Leo EikelmanDirector, IT and Business DevelopmentCommented:
I don't know if there is such a solution, but this one is close

Dim rs as recordset
'Fill your recordset from database

'and write this code
Dim strRS as string
Open "c:\rs.csv" for output as #1
while not rs.eof
 print #1,strData
 ' dont use rs.MoveNext
close #1
set rs=nothing

you can fiddle with the .GetString method to get the format u want


Leo EikelmanDirector, IT and Business DevelopmentCommented:
: )
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now