• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 330
  • 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?
0
surfsista9
Asked:
surfsista9
1 Solution
 
Naveen SwamyCommented:
getrows and getstring

check out there help and use it, it is far better than using/looping the rs objects
0
 
mah8473Commented:
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:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dtssql/dts_basic_5zg3.asp
0
 
mah8473Commented:
Navstar16,

good point getrows would be A hell of a lot easier!!!!!!!!!!!!!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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.
0
 
Leo EikelmanCommented:
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
 strRS=rs.GetString(adClipString,1,vbTab,vbTab,Empty)
 print #1,strData
 ' dont use rs.MoveNext
wend
close #1
set rs=nothing

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

Cheers,

Leo
0
 
Leo EikelmanCommented:
: )
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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