473,327 Members | 2,081 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,327 software developers and data experts.

DoCmd.TransferText to import text from a large text file

Hi. I'm new to this board and have a few questions about using the
method referred to in the topic of this message.

I have manually transferred over 1/2 million records from a text file
into my Access table in under 1 minute, using File>Get External
Data>Import, then specifying .txt as the data source, selecting
the text file, and walking through the resulting Wizard.

I'm thinking I can do the same thing with DoCmd.TransferText, but
don't understand all the parameters. The basic format is:

DoCmd.TransferText (TransferType, SpecificationName, TableName,
FileName, HasFieldNames, HTMLTableName, CodePage)

Here's what I have so far:

DoCmd.TransferText(acImportDelim,, "MyTable", "Path to text file"). I
don't think I need any of the last parameters. When I exit this line
in my VB6 app, however, I get the error message, "Compile error.
Expected =".

I think the key is including the SpecificationName, which I don't
understand. Any ideas? If SpecificationName is a path to some file
with import specifications, could someone also please explain the
format of this file and include an example?

My table has three fields, all text type, the first field indexed, no
primary key (don't need one). My text file contains comma delimited
rows such as:

Row1Field1Value, Row1Field2Value, Row1Field3Value
Row2Field1Value, Row2Field2Value, Row2Field3Value
etc...

Like I said, this imports in less than a minute manually in Access,
and I'm thinking will do the same from with my VB app.

Thanks ahead for help.

Nov 13 '05 #1
3 12614
Rog
Do a manual import (Get external data / import), change the file type
to txt and click on Import. When the import text wizard opens, click
on Advanced. That's where you can define your import specification.

Nov 13 '05 #2
Hm, when working with Access 2003, I've seen this error pop up from
time to time. I've responded to it by removing parenthesis from
procedure calls (i.e. calls that don't return a value). So, try this
instead:

DoCmd.TransferText acImportDelim,, "MyTable", "Path to text file"

Nov 13 '05 #3
yeah no shit.. i think that is a bug in access also.

removing paranthesis shouldn't be necessary but these drunk monkeys in
redmond are too lazy to fix BUGS.

I have a laundry list of a dozen bugs in Access and Microsoft won't
FRIGGIN FIX THEM.

Nov 13 '05 #4

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

Similar topics

2
by: ms | last post by:
In Access 2000, I am using... 'Import Raw text to stageBMIDLog table. DoCmd.TransferText acImportFixed, "BMIDLog Link Specification", "stageBMIDLog", file ....to import raw records into a...
4
by: Teresa | last post by:
I'm trying to import a tab delimited text file. The text file does not have column heading. I can give it column heading if needed. How do I change the defult comma delimited to tab? If I...
11
by: Shyguy | last post by:
I need to import a text file pretty much daily. I download the file and change the name to a standard name and then run the code to import the file into a table in my database. The problem is...
1
by: ghadley_00 | last post by:
Hi, I have a MS access database table for which I regularly need to import fixed width text data. At present I have to to cut and paste the text data from its source to a text file, save the...
0
by: Chris | last post by:
Hi, I am using the command below for exporting data to text file. One of the query columns has SINGLE number type with decimal ponts as auto. DoCmd.TransferText acExportDelim,...
1
by: amitk | last post by:
Hello, I'm using Access 2002-2003. My application exports an Access table into a text file and then appends the text file with several othet files to generate a final file XXXX.ftm . ...
0
by: Cuaracao | last post by:
This is my code: Code1: 'DoCmd.OpenTable "tblImport" 'DoCmd.TransferDatabase acExport, "dBASE IV", strOutputDir,acTable,"sel_TblImport", strDbfName & ".dbf", False ' DoCmd.Close acTable,...
1
by: rahul26 | last post by:
Hi All, I have got a requirement that I need to import a large CSV file with more then 80k records with some 14 columns to a table directly in MSAccess. I am a newbie (basically a business analyst...
10
by: dnwise2 | last post by:
I have an access database that uses vba to retrieve .txt files from a specific location and places them in specific tables within the access database. Previously (many years), the .txt file names...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.