[AccessD] Problem Exporting to a CSV file with a Column Name that has a #

Darryl Collins Darryl.Collins at iag.com.au
Tue Apr 19 20:26:03 CDT 2011


_______________________________________________________________________________________

Note: This e-mail is subject to the disclaimer contained at the bottom of this message.
_______________________________________________________________________________________



Perhaps a cheap and easy solution that may work nicely is to use a valid placeholder during the export and creation of the CSV file instead of the "#".  Maybe something like "Employee$" and then once the CSV is exported use code to perform a global search and replace on the .txt file where the "#" char is not going to be an issue.

.replace ""Employee$", ""Employee#"

or similar.

hth a bit

Regards
Darryl.

 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Wednesday, 20 April 2011 8:23 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Problem Exporting to a CSV file with a Column Name that has a #

All, 

We are just starting to use an Access 2007 application to feed data to
another outside system via a CSV file. 

This outside system is very rigid and we need to use exact field names
on the CSV file that we are creating.

The catch is that one of the fields is call "Employee #".

We set up an Export Specification (called Export-Query1 for our testing)
and we are using the following command to do the export

DoCmd.RunSavedImportExport "Export-Query1"

When we run the application, everything works nicely, except the field
named "Employee #" is somehow being renamed "Employee ." in the
generated CSV file.

We have run a number of tests and it looks like we have stumbled upon
either a "bug" a "feature", or something that we just don't understand.

Is there a way to force Access to not replace the "#" with a "."  ?

Thanks for your help,

Brad 
  

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________________________________________________

The information transmitted in this message and its attachments (if any) is intended 
only for the person or entity to which it is addressed.
The message may contain confidential and/or privileged material. Any review, 
retransmission, dissemination or other use of, or taking of any action in reliance 
upon this information, by persons or entities other than the intended recipient is 
prohibited.

If you have received this in error, please contact the sender and delete this e-mail 
and associated material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or distribute 
the information contained in this e-mail and any attached files, with the permission 
of the sender.

This message has been scanned for viruses.
_______________________________________________________________________________________




More information about the AccessD mailing list