Access Docmd.TransferText exports data as hex (1 Viewer)

MrBedo

New member
Local time
Today, 11:59
Joined
Oct 6, 2010
Messages
6
First off, I just want to say hello and apologise if this isn't the correct forum for my question. The question relates to some VBA code which exports a table built using a query off the back of user input into a form.

So I wasn't exactly sure which forum this should sit in; Table, Query, VBA or Forms! :D

I'm not exactly new to Access, I know my way around enough to build basic databases. I'm fairly confident with VBS and have taken some tentative steps into VBA with my latest Access DB.

I've all but finished a DB I'm working on, but I'm falling at the final hurdle.

I have a button on a form with the following code attached. It exports a table called "Export" to a file called "export.csv". It uses an export specification called "Export" (believe it or not, this part of my DB deals with exporting ;)).


DoCmd.TransferText acExportDelim, "export", "export", "C:\export.csv", True


The button works fine and does indeed output the data to a csv file. Problem is, when I edit the "Export.csv" in notepad, all the data has come through as hex values (except the column headers, they come through in plain text). It's definitely exporting the correct data because I've run some of it through a hex translator to make sure it's not pulling some random data from somewhere.



If I export a different table, the csv data comes through in plain text, as it should be. The only difference as far as I can tell between these two tables is that the "Export" table is built using an "append table" query from a combination of existing tables and user input (via a form). As a result (?), the "Export" table's data type is shown as "Binary" in the design view. I have duplicated the table manually and changed all the data types to "Text", but the csv still pulls through the data as hex values.


Am I on the right track here? Could the fact that the data type is binary be causing the export to show itself as hex values?


If anyone can throw any light on this, it would be much appreciated!

cheers
 
Last edited:

MrBedo

New member
Local time
Today, 11:59
Joined
Oct 6, 2010
Messages
6
Nevermind, I got around it by exporting the data in a different way.

Glad to see that it wasn't just me that was stumped by it though!

;)
 

Users who are viewing this thread

Top Bottom