Record to text file

I want to read a result of stored-procedure and transfer it out to a fixed length text file. Also , if I can have the option to change the data before I transfer it out to the text file.
eliasisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ventondCommented:
Establish Recordset
Open file for output
do while recordset.eof = false
print file, data
recordset.movenext
loop
close file


Just make your "data" fixed length, your file will follow.
0
eliasisAuthor Commented:
What if I need to change data in a field before it would be transfered to text file?
0
DrDelphiCommented:
Sorry, No VB installed here...


Type  MyRecord
 Field1 as string *40
 Field2 as string *40
 Field3 as string *40
 end type
dim Arecord as Myrecord


in a button click, etc...

open "SomeFile.txt" for random as #1
  Arecord.filed1=recordset.filedX
  Arecord.filed2=recordset.filedX
  Arecord.filed3=recordset.filedX
  put #1,,Arecord
  close


-OF COURSE YOU'LL HAVE TO HANDLE SWAPPING DATA IN ARECORD PRIOR TO SAVING, BUT THIS GIVES YOU THE GENMERAL IDEA.

Good luck!!




0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ventondCommented:
before the print command, set the "data" to whatever you like. It doesn't even have to have anything to do with the recordset. YOU control what you print, YOU can change it, skip it, double print it, whatever.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.