DoCmd.TransferText

G

google3luo359

Hello,

I'd really appreciate help in getting this DoCmd.TransferText command
working on my form.
I've tried all kinds of different syntax but nothing seems to be
working.
Here are some of the errors I've gotten as I change the code:

- You have specified a Transfer Type that doesn't support the HTML
Table Name argument.
- Wrong number of arguments or invlaid property assignment
- Invalid argument

This is the last line of code I tried, that received the 'Invalid
argument':

DoCmd.TransferText acImportDelim, , "StudentsTemp",
"d:\School\Aep\StudentsCSV.txt", , , True

It's a very straightforward import of a CSV text file into a table.

Any help would be appreciated

Ric
 
G

google3luo359

'69 Camaro said:
Try:

DoCmd.TransferText acImportDelim, , "StudentsTemp",
"d:\School\Aep\StudentsCSV.txt", True

HTH.
Gunny


Thanks for your help Gunny!

I receive the following message with your code:

Field '444204150' doesn't exist in destination table 'StudentTemp'.

I seem to be so close in getting this to work. I've been struggling now
for hours!
There are no field titles in either my Table or the .txt file.
The code is looking for a Field Name/title of '444204150' in my Table
and of course it doesn't exist.

444204150 is the first value in my .txt file.

TIA Ric
 
G

google3luo359

Hi Gunny,

I finally got it to work, after hours of trying!
This is one heck of a cryptic feature in Access.

I needed a *very fussy* ImportSpec before it would work.

A question about Import Specs. When I finalize and split this db down
the road, will the Import Spec reside in the back end or the front end?

Thanks!

Ric
 
6

'69 Camaro

Hi, Ric.
When I finalize and split this db down
the road, will the Import Spec reside in the back end or the front end?

If you use the database splitter, the specs will only reside in the front
end. You'll need to open the back end separately and import the specs from
the front end database file into the back end database file. When you
import, make sure that you select the "Options" button to display the import
options, then ensure that the Import/Export specs check box is marked.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
G

google3luo359

'69 Camaro said:
If you use the database splitter, the specs will only reside in the front
end. You'll need to open the back end separately and import the specs from
the front end database file into the back end database file. When you
import, make sure that you select the "Options" button to display the import
options, then ensure that the Import/Export specs check box is marked.

Hi Gunny,

I'd like to be very clear about how this will work because it will be
very important for this db (at various sites).
First of all for the db to function properly after it's split, that is,
for it to be able to accept importing of .txt files into the db, will I
need to have the Import Spec on BOTH the front and back end?

If I need the Spec on the back end too, how do I find it?
When you import, make sure that you select the "Options" button to display the import
options, then ensure that the Import/Export specs check box is marked.

I don't see an "Options" button when I select Import, showing import
options.

TIA Ric
 
6

'69 Camaro

Hi, Ric.
First of all for the db to function properly after it's split, that is,
for it to be able to accept importing of .txt files into the db, will I
need to have the Import Spec on BOTH the front and back end?

The import spec needs to reside in the database file that is running the
TransferText code. When you split the database, that code will reside in
the front end. However, there are occasions when database maintenence needs
to be performed on the back end (just DBA stuff, not user stuff), and having
the correct import specs already in the back end may save some time and
frustration. However, there's no requirement to store the import specs in
the back end if they aren't needed there, and usually, they aren't.
If I need the Spec on the back end too, how do I find it?

Select the File -> Get External Data -> Import... menu to open the Import
dialog window. Navigate to the text file that you want to import and select
it. Then select the "Import" button to open the Import Text Wizard. Select
I don't see an "Options" button when I select Import, showing import
options.

Select the File -> Get External Data -> Import... menu to open the Import
dialog window. Navigate to the database file that you want to import and
select it. Then select the "Import" button to open the Import Objects
dialog window. On the bottom right corner of this window, you'll see the
"Options >>" button. Select this button and you'll see the import options.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 

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