INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

print records in clolumnar mode

print records in clolumnar mode

(OP)
I need to export in a txt file a recordset from access and ado, in columnar mode, with the head of names of records
How to?

Similar the format of attached txt.

NOTE:
each records have the max lenght 25 characters
Linkhttp://files.engineering.com/getfile.aspx?folder=0...

RE: print records in clolumnar mode

Your file looks like this:

F1         F2                         F3 ...                       FN
AAAAA BBBBBBBB            CCCCCCCCCCCCC DDDDD 
AAAAA BBBBBB                CC                          DDDDD
AAAAA BBBBBBBBBBBB  CCCCCCCCCCCCC  DDDDD
...
AAAAA B                           CCCCCCCCCCCCC D 
 

Is that supposed to be a fixed-length text file?
And look like this?

F1         F2             F3 ...                       FN
AAAAA BBBBBBBB      CCCCCCCCCCCCC DDDDD 
AAAAA BBBBBB        CC            DDDDD
AAAAA BBBBBBBBBBBB  CCCCCCCCCCCCC DDDDD
...
AAAAA B             CCCCCCCCCCCCC D 
 

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: print records in clolumnar mode

Text files have no formatting, and even tab stops are subject to interpretation by whatever program reads the file. So all you can do is "format" by selectively adding blank spaces within lines.

In VB6 you can do this via native text I/O using the Tab() pseudo-function within Print # statements. This is covered in the documentation.

RE: print records in clolumnar mode

This is actually not that difficult to do:
Add a Reference to Microsoft ActiveX Data Objects X.X Library
Make a connection to your Access data base
Create an ADODB recordset
Open your text file for output
Loop thru recordset’s fields names (rst.Fields(x).Name) - fill it with Spaces
Write it into your text file
Loop thru records in your recordset and for every record:
---Loop thru all fields (rst.Fields(x).Value) - fill it with Spaces
---Write it into your text file
Close your text file.
UR Done.

The “fill it with Spaces” you can use rst.Fields(x).DefinedSize to get the width of every field in your recordset.

Have fun.

---- Andy

There is a great need for a sarcasm font.

RE: print records in clolumnar mode

Or you could use the text ISAM

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close