473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Access Table to text file (CSV, Tab, etc). Is there an easy way to do this?

Hi,

I have an MS Access Database with 1 Table containing about 2 million records
in Unicode (diferent languages).

I would like to export the Table to a Text file (CSV, Tab, etc.)

Access dows only export about 65,000 at 1 time.
Almost an imposible job.

I have tried to write different Visual Basic Code to export this Table, but
the Text file was rubbish.

Does anyone knows of an easy way to perform this task?
Or a Freeware program to do this?

This only need to be done once.

TIA

Irene

Jul 8 '08 #1
8 11051
Are you sure the file is limited to 64k records?

I just tried exporting a table with 150k records to a CSV file in A2007. All
rows exported.

If you are using an earlier version, did you open the CSV with Excel? If so,
the problem may be with the number of rows Excel can display rather than the
number of rows that Access exported.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Irene" <ir***@hotmail.comwrote in message
news:48***********************@read.cnntp.org...
Hi,

I have an MS Access Database with 1 Table containing about 2 million
records
in Unicode (diferent languages).

I would like to export the Table to a Text file (CSV, Tab, etc.)

Access dows only export about 65,000 at 1 time.
Almost an imposible job.

I have tried to write different Visual Basic Code to export this Table,
but
the Text file was rubbish.

Does anyone knows of an easy way to perform this task?
Or a Freeware program to do this?
Jul 8 '08 #2
"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
Are you sure the file is limited to 64k records?

I just tried exporting a table with 150k records to a CSV file in A2007.
All rows exported.
I have tried again and got the following error message:

"You selected more records than can be copied onto the clipboard at one
time.
Divide the records into two or more groups, and the copy and paste one group
at the time.
The maximum number of records you can paste at one time is approximately
65,000."

(I have MS Office 2003 installed.)

If you are using an earlier version, did you open the CSV with Excel? If
so, the problem may be with the number of rows Excel can display rather
than the number of rows that Access exported.
I think (but I'm not sure) that I made the initial Table importing an MS
Excell worksheet due to the fact that my file was passing the limit of 65535
entries.

Any valuable solutions in sight?
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Irene" <ir***@hotmail.comwrote in message
news:48***********************@read.cnntp.org...
>Hi,

I have an MS Access Database with 1 Table containing about 2 million
records
in Unicode (diferent languages).

I would like to export the Table to a Text file (CSV, Tab, etc.)

Access dows only export about 65,000 at 1 time.
Almost an imposible job.

I have tried to write different Visual Basic Code to export this Table,
but
the Text file was rubbish.

Does anyone knows of an easy way to perform this task?
Or a Freeware program to do this?

Jul 8 '08 #3
Oh: you tried to copy them to clipboard.

I assumed you were using TransferText in code or a macro.
Could you add a button to your form, and create a macro with TransferText?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Irene" <ir***@hotmail.comwrote in message
news:48***********************@read.cnntp.org...
"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
>Are you sure the file is limited to 64k records?

I just tried exporting a table with 150k records to a CSV file in A2007.
All rows exported.

I have tried again and got the following error message:

"You selected more records than can be copied onto the clipboard at one
time.
Divide the records into two or more groups, and the copy and paste one
group at the time.
The maximum number of records you can paste at one time is approximately
65,000."

(I have MS Office 2003 installed.)

>If you are using an earlier version, did you open the CSV with Excel? If
so, the problem may be with the number of rows Excel can display rather
than the number of rows that Access exported.

I think (but I'm not sure) that I made the initial Table importing an MS
Excell worksheet due to the fact that my file was passing the limit of
65535 entries.
Jul 8 '08 #4
Irene

If you are only doing this once why bother with code? Just do an export of
the file to a text file.
Highlight the table in the objects panel. Select "File", "Export" on the
main menu. On the panel that pops up change the "save as type" to "Text";
give file a name and click "Export". Done!
"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
Oh: you tried to copy them to clipboard.

I assumed you were using TransferText in code or a macro.
Could you add a button to your form, and create a macro with TransferText?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Irene" <ir***@hotmail.comwrote in message
news:48***********************@read.cnntp.org...
>"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
>>Are you sure the file is limited to 64k records?

I just tried exporting a table with 150k records to a CSV file in A2007.
All rows exported.

I have tried again and got the following error message:

"You selected more records than can be copied onto the clipboard at one
time.
Divide the records into two or more groups, and the copy and paste one
group at the time.
The maximum number of records you can paste at one time is approximately
65,000."

(I have MS Office 2003 installed.)

>>If you are using an earlier version, did you open the CSV with Excel? If
so, the problem may be with the number of rows Excel can display rather
than the number of rows that Access exported.

I think (but I'm not sure) that I made the initial Table importing an MS
Excell worksheet due to the fact that my file was passing the limit of
65535 entries.

Jul 8 '08 #5
Read my response to Allen Browne
"KC-Mass" <connearneyATcomcastDOTnetwrote in message
news:8e******************************@comcast.com. ..
Irene

If you are only doing this once why bother with code? Just do an export
of the file to a text file.
Highlight the table in the objects panel. Select "File", "Export" on the
main menu. On the panel that pops up change the "save as type" to "Text";
give file a name and click "Export". Done!
"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
>Oh: you tried to copy them to clipboard.

I assumed you were using TransferText in code or a macro.
Could you add a button to your form, and create a macro with
TransferText?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Irene" <ir***@hotmail.comwrote in message
news:48***********************@read.cnntp.org.. .
>>"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
Are you sure the file is limited to 64k records?

I just tried exporting a table with 150k records to a CSV file in
A2007. All rows exported.

I have tried again and got the following error message:

"You selected more records than can be copied onto the clipboard at one
time.
Divide the records into two or more groups, and the copy and paste one
group at the time.
The maximum number of records you can paste at one time is approximately
65,000."

(I have MS Office 2003 installed.)
If you are using an earlier version, did you open the CSV with Excel?
If so, the problem may be with the number of rows Excel can display
rather than the number of rows that Access exported.

I think (but I'm not sure) that I made the initial Table importing an MS
Excell worksheet due to the fact that my file was passing the limit of
65535 entries.


Jul 9 '08 #6
"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
Oh: you tried to copy them to clipboard.
No, I didn't.

I did click: "Menu -File -Export -Text files (*.txt, *.csv, *.tab,
*.asc) -Save Formatted -Export All

A Message Window opened with 4 choices, Windows (default), MS-DOS, Unicode,
Unicode (UTF-8).
I did try: Windows (default) and Unicode.

Then another Message Window appears as described before.

"You selected more records than can be copied onto the clipboard at one
time.
Divide the records into two or more groups, and the copy and paste one group
at the time.
The maximum number of records you can paste at one time is approximately
65,000."

Clicking OK, exports exactly 65534 records.

I did also try the solution "Save as" as proposed by KC-Mass, with the same
results.
I assumed you were using TransferText in code or a macro.
Never heard of "TransferText" Macro.
Could you add a button to your form, and create a macro with TransferText?
Can you clarify please?

Do I need first to create a form, add a button named "TransferText", and if
the Button is selected, activate a Macro "TransferText"..?
Where is this Macro?

I run:

Microsoft Ofice Access 2003 (11.5614.5606)
Part of Microsoft Office Professional Edition 2003
Microsoft Windows XP Pack 3

Irene

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Irene" <ir***@hotmail.comwrote in message
news:48***********************@read.cnntp.org...
>"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
>>Are you sure the file is limited to 64k records?

I just tried exporting a table with 150k records to a CSV file in A2007.
All rows exported.

I have tried again and got the following error message:

"You selected more records than can be copied onto the clipboard at one
time.
Divide the records into two or more groups, and the copy and paste one
group at the time.
The maximum number of records you can paste at one time is approximately
65,000."

(I have MS Office 2003 installed.)

>>If you are using an earlier version, did you open the CSV with Excel? If
so, the problem may be with the number of rows Excel can display rather
than the number of rows that Access exported.

I think (but I'm not sure) that I made the initial Table importing an MS
Excell worksheet due to the fact that my file was passing the limit of
65535 entries.


Jul 9 '08 #7
Runnung this code

-----------
Private Sub BlahBlah()
Dim Recordset As ADODB.Recordset
Dim Buffer$
Dim FileNumber%
Set Recordset = CurrentProject.Connection.Execute("SELECT * FROM
Employees")
Buffer = Recordset.GetString(adClipString, , vbTab, vbNewLine)
FileNumber = FreeFile
Open "temp.txt" For Binary As #FileNumber
Put #FileNumber, , Buffer
Close #FileNumber
End Sub
-----------

creates file "temp.txt"

in Northwoods the contents of temp.txt are

-----------
1 Northwind Traders Freehafer Nancy na***@northwindtraders.com
Sales Representative (123)555-0100 (123)555-0102 (123)555-
0103 123 1st Avenue Seattle WA 99999 USA
#http://northwindtraders.com#
2 Northwind Traders Cencini Andrew an****@northwindtraders.com
Vice President, Sales (123)555-0100 (123)555-0102 (123)555-
0103 123 2nd Avenue Bellevue WA 99999 USA
http://northwindtraders.com#http://n...dtraders.com/# Joined the
company as a sales representative, was promoted to sales manager and was
then named vice president of sales.
3 Northwind Traders Kotas Jan ja*@northwindtraders.com Sales
Representative (123)555-0100 (123)555-0102 (123)555-0103 123 3rd
Avenue Redmond WA 99999 USA
http://northwindtraders.com#http://n...dtraders.com/# Was hired
as a sales associate and was promoted to sales representative.
4 Northwind Traders Sergienko Mariya ma****@northwindtraders.com
Sales Representative (123)555-0100 (123)555-0102 (123)555-
0103 123 4th Avenue Kirkland WA 99999 USA
http://northwindtraders.com#http://n...dtraders.com/#
5 Northwind Traders Thorpe Steven st****@northwindtraders.com
Sales Manager (123)555-0100 (123)555-0102 (123)555-0103 123
5th Avenue Seattle WA 99999 USA
http://northwindtraders.com#http://n...dtraders.com/# Joined the
company as a sales representative and was promoted to sales manager.
Fluent in French.
6 Northwind Traders Neipper Michael mi*****@northwindtraders.com
Sales Representative (123)555-0100 (123)555-0102 (123)555-
0103 123 6th Avenue Redmond WA 99999 USA
http://northwindtraders.com#http://n...dtraders.com/# Fluent in
Japanese and can read and write French, Portuguese, and Spanish.
7 Northwind Traders Zare Robert ro****@northwindtraders.com Sales
Representative (123)555-0100 (123)555-0102 (123)555-0103 123 7th
Avenue Seattle WA 99999 USA
http://northwindtraders.com#http://n...dtraders.com/#
8 Northwind Traders Giussani Laura la***@northwindtraders.com
Sales Coordinator (123)555-0100 (123)555-0102 (123)555-0103
123 8th Avenue Redmond WA 99999 USA
http://northwindtraders.com#http://n...dtraders.com/# Reads and
writes French.
9 Northwind Traders Hellung-Larsen Anne an**@northwindtraders.com
Sales Representative (123)555-0100 (123)555-0102 (123)555-
0103 123 9th Avenue Seattle WA 99999 USA
http://northwindtraders.com#http://n...dtraders.com/# Fluent in
French and German.
-----------

One would change the field delimiter to a comma by modifying

Buffer = Recordset.GetString(adClipString, , vbTab, vbNewLine)
to
Buffer = Recordset.GetString(adClipString, , ",", vbNewLine)

Would this do two million records? I don't know. If not, it could be
modified to add 60000 (3%) at a time to temp.txt.

Access 2003 should have a default ADO reference unless some genius
removed it.
"Irene" <ir***@hotmail.comwrote in
news:48***********************@read.cnntp.org:
Hi,

I have an MS Access Database with 1 Table containing about 2 million
records in Unicode (diferent languages).

I would like to export the Table to a Text file (CSV, Tab, etc.)

Access dows only export about 65,000 at 1 time.
Almost an imposible job.

I have tried to write different Visual Basic Code to export this
Table, but the Text file was rubbish.

Does anyone knows of an easy way to perform this task?
Or a Freeware program to do this?

This only need to be done once.

TIA

Irene
Jul 9 '08 #8
Found the magic trick.

Your solution made me try to do a "Select All" before selecting to "Export"
or to "Save as".
And Bingo, all the records have been exported to a file.

Apparently, if one clicks on Export without doing a "Select All", MS Access
exports only 65534 records.
Even if you click on "Export All".

Thank you all for you help.
"KC-Mass" <connearneyATcomcastDOTnetwrote in message
news:8e******************************@comcast.com. ..
Irene

If you are only doing this once why bother with code? Just do an export
of the file to a text file.
Highlight the table in the objects panel. Select "File", "Export" on the
main menu. On the panel that pops up change the "save as type" to "Text";
give file a name and click "Export". Done!
"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
>Oh: you tried to copy them to clipboard.

I assumed you were using TransferText in code or a macro.
Could you add a button to your form, and create a macro with
TransferText?

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Irene" <ir***@hotmail.comwrote in message
news:48***********************@read.cnntp.org.. .
>>"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:48**********************@per-qv1-newsreader-01.iinet.net.au...
Are you sure the file is limited to 64k records?

I just tried exporting a table with 150k records to a CSV file in
A2007. All rows exported.

I have tried again and got the following error message:

"You selected more records than can be copied onto the clipboard at one
time.
Divide the records into two or more groups, and the copy and paste one
group at the time.
The maximum number of records you can paste at one time is approximately
65,000."

(I have MS Office 2003 installed.)
If you are using an earlier version, did you open the CSV with Excel?
If so, the problem may be with the number of rows Excel can display
rather than the number of rows that Access exported.

I think (but I'm not sure) that I made the initial Table importing an MS
Excell worksheet due to the fact that my file was passing the limit of
65535 entries.


Jul 9 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Pratt | last post by:
Hi. I have files that I will be importing in at least four different plain text formats, one of them being tab delimited format, a couple being token based uses pipes (but not delimited with...
1
by: Alex | last post by:
Hi, Everyday, I download data from a webpage and manually input data into my MS Access database. I am thinking of automate the routine by a VB script. The webpage I am visiting will return a...
4
by: pietlinden | last post by:
I almost feel stupid posting this, but maybe someone else understands what's going on here. I am importing a delimited text file, and have saved an import specification so that for the user the...
1
by: JH | last post by:
I have a comma delimited file and I want to export it to an MS access table already designed with appropriate field names. How do I do this programmatically using VB.NET or C#? Thanks for any...
3
by: excyauseme | last post by:
Hi guys! Do you know what is the best way to export a text file, this one is a log file that is already comma delimited thru a module run by my access database, to an excel spreadsheet? I need to...
25
by: DFS | last post by:
I have a job to automatically import Excel data and post to database tables, via a point-click interface. Choose-file-and-it-does-the-rest kind of thing. Cient stores data in columns in his...
6
by: No Spam Man | last post by:
Hi, I am not a programmer and in the past have only created very simple, flat file databases. Although I'm a newbie, I think I could probably figure out basic Boolean logic and financial...
2
by: KingoftheKings | last post by:
I'm new here. I want a help with VB codes that will import text or excel files from a specified directory in to an existing or new Access table. I have written some codes, but when I click the...
4
by: johnporter123 | last post by:
Does anyone have a method of importing a large "FLAT" CSV file into access. The file has well over 255 columns (Fields). Before anyone flames me over normalization, I do not have access to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.