exporting table

G

Guest

I have a table with just one column with 3000 rows. I need to export into a
CSV file so that it looks like this:

data1,data2,data3,data4, etc.

Is this possible? I've attmpeted using the Export Wizard but can't get it.

Thanks!
 
M

Marshall Barton

brian said:
I have a table with just one column with 3000 rows. I need to export into a
CSV file so that it looks like this:

data1,data2,data3,data4, etc.


Exporting rows means you will get lines in the text file, so
you need to export a single row with all the values. This
can be done using a function like
http://www.rogersaccesslibrary.com/...Generic Function To Concatenate Child Records'
that concatenates all the rows. If you create a table with
one row, you can export a query like:
SELECT ConCatenate("SELECT yourfield FROM yourtable", ",")
FROM onerowtable

A completely different approach would be to use Access' file
I/O statements to create the file. This air code outline
provides the general idea:

fnum = FreeFile()
Open "filepath" For Output As fnum
set rs = db.OpenRecordset("yourtable")
Do Until rs.EOF
Print rs!yourfield;
rs.MoveNext
Loop
Close fnum
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top