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