Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

docmd outputto

Status
Not open for further replies.

GShen

MIS
Sep 26, 2002
561
0
0
US
When using the format:
DoCmd.OutputTo acOutputStoredProcedure, "spname", acFormatTXT, pathandfilename, False ...... how do you stop the heading from appearing? I just want he raw data. Also, when I use txt, it is chopping my output and putting dashes on top, below and on the sides. See below for problem output:
----------------------
| tblepoftp_Data |
----------------------
| ISA*00* |
----------------------
| GS*OG*1111111111*6 |
----------------------

I can't find anyway to suppress this or just give me the data. I can't use a table because I don't want the key. I just want the data field. I tried using docmd.transfer but the problem there is that I can't get it to work with a stored procedure. I can't use the table because I do not want the key and it HAS to be in the sequence I write it to the table. If you tell me it will always write out in the sequence I write to the table, then I can go back to the transfer text. I tried doing this query thing but it looks like that is an MDB thing, not ADP.

If I confused anyone, let know I will try and rewrite this.

THanks Gary

Remember when... everything worked and there was a reason for it?
 
I noticed in the data 'tblepoftp_Data' is this a table?

acOutputStoredProcedure The type of object containing the data to output not the end result

The -------- separate the records and the | act as delimiters.

how about writing your own sortorder key then transfering the data?

Thoughts

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
What format do you want? Have you tried using TransferText?
Code:
Private Sub cmdOutputQuery_Click()
On Error GoTo Err_cmdOutputQuery_Click

    Dim stDocName As String

    stDocName = "qselOurMailing"
    DoCmd.TransferText acExportDelim, "", stDocName, "C:\temp\qselOurMailing.csv", False
    

Exit_cmdOutputQuery_Click:
    Exit Sub

Err_cmdOutputQuery_Click:
    MsgBox Err.Description
    Resume Exit_cmdOutputQuery_Click
    
End Sub

Duane
Hook'D on Access
MS Access MVP
 
Hi everyone,
Just got back to this.

Mazeworx,
There are 2 fields in my table. The 1st is an autonumber which I have as the key to keep this in order. The field 'tblepoftp_Data' is the other field in the table.

Duane,
Everytime I tried using Transfer text, it does not like using a stored procedure. I tried 72 interations and finally gave up.
transfer text works great with tables. If I eliminate the key to the access table and just have the data, how can I be sure that the data will get transferred in the exact order I wrote it to the table in? I read some where, that it may change the sequence. It has to be in seq., hence the autonumber and key.

I tried what you said again just to make sure I was no going crazy and I received the same message again. See attached. It states it cannot find the object.... and then it lists the stored procedure name.

THanks,
Gary



Remember when... everything worked and there was a reason for it?
 
 http://www.mediafire.com/download.php?ef4ghc50cwbf51d
use a query sorted on the key field but don't show that field and then output the query using TransferText

PaulF
 
Not sure I follow you Paul. The problem is you cannot use a query and the transfer text. In my case the query is a stored procedure. This is an ADP. It simply does not work. That is exactly what my SP does. It used the data field as output and does not use the Autonumber but indeed sorts on it.

Remember when... everything worked and there was a reason for it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top