We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Read an entire ado recordset row?

surfsista9 asked
Medium Priority
Last Modified: 2010-05-18
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?
Watch Question

Naveen SwamyYash Infinite Solutions Private Limited

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!!!!!!!!!!!!!


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.
Director, IT and Business Development
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



Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Leo EikelmanDirector, IT and Business Development

: )
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.