Exporting Certian Fields

adenwalker

Registered User.
Local time
Today, 07:52
Joined
Jan 18, 2005
Messages
39
I have a table with the fields username, password, userlevel, blocked, name.

I want to be able to export the fields username and password to a text file in the format of:
USERNAME1|PASSWORD1
USERNAME2|PASSWORD2
USERNAME3|PASSWORD3
USERNAME4|PASSWORD4

Can anybody help me as i am not sure on how to do this!
Thanks in advance
Aden
 
Do a query that put's the stuff all in one field, with the "|" chars where neded, then export as a .txt.


???
 
How do i do that then!!!
 
In the query just do something like:

mynewfield: [USERNAME] & " | " & [PASSWORD]


Then read up on 'OutputTo' in Access/vb help...
 
I have tried the output but it outputs the data as
"USERNAME1|PASSWORD1"
"USERNAME2|PASSWORD2"

But i need it as
USERNAME1|PASSWORD1
USERNAME2|PASSWORD2

I'm a bit stuck!
 
Check your table and code.

I have attached screen shots of Ken's suggestion.
 

Attachments

Sorry Aden I might of misinterpreted your posting

Did you manage to EXPORT the data if so how did you perform this?

Can I suggest creating a macro and selection TransferText and select transfer type as Export Delimited.
 
GSM said:
Can I suggest creating a macro and selection TransferText and select transfer type as Export Delimited.

I have tried the above but still get "" marks around the text. I need the text without these.

Thanks
 
right click table and select Export.
In the Dialouge box set Save As Type to "Text Files(*.txt;*.csv.......)
Give the file a name
Click export
Select Delimited click Next
Select other and add you | seperator
in the "Text Qualifier" dropdown select {none}
Click Finnish to save data.

If you are going to do this often then you could click Advanced>save as.. before finnishing and save the export spec for use in code.

HTH

Peter
 
This does work but it exports all fields in the table, where as i only want the first two.
 
do the same thing but on a query with just the two fields required then

Peter
 
Great, that worked. Thanks.

Is there a way the export method can be done via a macro. I mean to open the export window??? :D
 
I dont think so but if you save the export spec then you can use it to control the export anyway. you can specify which query to export and the name of the table to export to in the code

Peter
 

Users who are viewing this thread

Back
Top Bottom