Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

Need to use TransferText maintaining db record order

Hello,

In a VBA module, I am trying to use TransferText to export a table's records in fixed-length format using the order that the records appear in the table.  (The table is created by an update statement that inserts records in the order I need.)  However, when I use TransferText, the record order in the exported fixed width file does not appear as it does in the table.

I can force the order by creating a query by hand that specifies the order and then exporting the records, but I need it to work dynamically.

In short, is there a way to force the record order to when exporting to fixed-width using TransferText?  I suppose I could create a recordset and print out each record individually but calculating padding for a  fixed-width, 30 field record is going to get messy.
0
enrite
Asked:
enrite
1 Solution
 
aesmikeCommented:
Creatae the Query and save it.
In your TransferText command, specify the Query, not the table name.
0
 
enriteAuthor Commented:
Hi aesmike,

Gah, duh...I just realized that when responding about how to dynamically create that query.  Of course, the data will change but not the query....

Thanks,

enrite
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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