473,890 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

transfertext acimportdelim/acexportdelim problem with field names

Hi,

i want to export a table for later import, using vba.

Thatīs my code:
export:

filename = "C:\HVOtabelle. txt"
DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename

import:

filename = "C:\HVOtabelle. txt"
DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename

so i got a new table called tblHVOnew, which should be identical with
tblHVOMaske1 (no, i donīt want to just copy the table, i need this for
further treatment)
But only the first fieldname has been imported with its right name. It
is called "Einsatznummer" . All the others are now called F1,F2,F3,...
until the fields end, but the got different names.
I also tried with

DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename, true
and
DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename,true

but i get the same strange result, that access gives my imported table
wrong field names

any ideas?

regards, Oli
Nov 13 '05 #1
3 9438
Oliver Gabriel wrote:
Hi,

i want to export a table for later import, using vba.

Thatīs my code:
export:

filename = "C:\HVOtabelle. txt"
DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename

import:

filename = "C:\HVOtabelle. txt"
DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename

so i got a new table called tblHVOnew, which should be identical with
tblHVOMaske1 (no, i donīt want to just copy the table, i need this for
further treatment)
But only the first fieldname has been imported with its right name. It
is called "Einsatznummer" . All the others are now called F1,F2,F3,...
until the fields end, but the got different names.
I also tried with

DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename, true
and
DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename,true

but i get the same strange result, that access gives my imported table
wrong field names

any ideas?

regards, Oli


Why don't you recreate the text specification file? When you export,
you can set it to display the fieldnames in the first row.

When you import, it should recognize the field names as the first row.
You can also click Advanced and enter the field names etc.

You should always remember to save your specifications after you have
updated them.
Nov 13 '05 #2
Salad wrote:
Oliver Gabriel wrote:
Hi,

i want to export a table for later import, using vba.

Thatīs my code:
export:

filename = "C:\HVOtabelle. txt"
DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename

import:

filename = "C:\HVOtabelle. txt"
DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename

so i got a new table called tblHVOnew, which should be identical with
tblHVOMaske1 (no, i donīt want to just copy the table, i need this for
further treatment)
But only the first fieldname has been imported with its right name. It
is called "Einsatznummer" . All the others are now called F1,F2,F3,...
until the fields end, but the got different names.
I also tried with

DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename, true
and
DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename,true

but i get the same strange result, that access gives my imported table
wrong field names

any ideas?

regards, Oli

Why don't you recreate the text specification file? When you export,
you can set it to display the fieldnames in the first row.

When you import, it should recognize the field names as the first row.
You can also click Advanced and enter the field names etc.

You should always remember to save your specifications after you have
updated them.


i am not sure i understand what you mean. the "true" in
do.CmdTransferT ext means that the first row are field names. but this
only works fine with the export.

regards, oli
Nov 13 '05 #3
Oliver Gabriel wrote:
Salad wrote:
Oliver Gabriel wrote:
Hi,

i want to export a table for later import, using vba.

Thatīs my code:
export:

filename = "C:\HVOtabelle. txt"
DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename

import:

filename = "C:\HVOtabelle. txt"
DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename

so i got a new table called tblHVOnew, which should be identical with
tblHVOMaske1 (no, i donīt want to just copy the table, i need this
for further treatment)
But only the first fieldname has been imported with its right name.
It is called "Einsatznummer" . All the others are now called
F1,F2,F3,... until the fields end, but the got different names.
I also tried with

DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename, true
and
DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename,true

but i get the same strange result, that access gives my imported
table wrong field names

any ideas?

regards, Oli


Why don't you recreate the text specification file? When you export,
you can set it to display the fieldnames in the first row.

When you import, it should recognize the field names as the first row.
You can also click Advanced and enter the field names etc.

You should always remember to save your specifications after you have
updated them.

i am not sure i understand what you mean. the "true" in
do.CmdTransferT ext means that the first row are field names. but this
only works fine with the export.

regards, oli


Ok, thanks... i got you and it works fine!!
regards, Oli
Nov 13 '05 #4

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

Similar topics

6
3059
by: Vladislav Moltchanov | last post by:
I have discovered a couple of years ago, that import with DoCMD.TransferText for CSV text file doesn’t work in Acc2000, while it works perfectly in ACC97. which has been discussed on this newsgroup forum, so this fact was fixed. Since I have to transfer files from VMS( SAS ) to WIN (Access), I still keep using ACC97 as a simplest and reliable tool. However, final products, such as distributable data entry system for multi central...
4
9486
by: khutch | last post by:
Not that up on MS Access. I understand that the TransferText command can be used to import csv files into a database. Question: Does the text file have to mirror the alignment of the table columns e.g. must field1, field2, filed3 etc correspond to col1, col2, col3 on the table? or can I state somewhere which columns in the text file correspond to which table columns. I actually need col1, col2, col5 and col6 from the text file to populate...
11
9191
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 that the file starts with a standard name but adds the date and some other stuff to the end of the file name. Is there a way I could use a wildcard like "*" so I wouldn't have to change the name? Thanks for any help
3
4378
by: Typehigh | last post by:
I am a pretty saavy user, but I am having a real problem with the DoCmd.TransferText operation. I manually used the File>Get External Data> Import routine to set up an import specification. It works like a champ everytime it's run. If I use VBA to execute a TransferText and specify the specfile, I get a Type Conversion Error on import and a table full of empty records (equal to the number of lines in my import data file). My data...
3
12719
by: holdemfoldem | last post by:
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...
0
1641
by: Daron | last post by:
I am posting this as I have not been able to find a direct posting with a specific solution, just work arounds (usually the need to create custom import routines.) I found the solution! I am using Access 2003. The problem: When using the TransferText command in code, the first record in the text file is skipped, even with the HasFieldNames set to False.
2
2303
by: Bill | last post by:
Is there any way that I can suppress the message that pops up after running: DoCmd.TransferText acImportDelim. I have the transfer text action on a form load so that every time the database it opened it checks for updates. The problem is that our end users don't really need to see how many records were imported. I'm looking for a way to keep that message from showing. Does anyone have any ideas on this?? Thanks
3
2652
by: Jim M | last post by:
I am trying to 'grab' a backend data path and filename from a text file (to be used when updated front ends are installed by users). I store this information by running: DoCmd.TransferText acExportDelim, , "qExportBackEndPath", Local_TxtFileName, True qExportBackEndPath simply pulls the text field 'BackEndPath' from my tblLocal, which has only one record containing a fields related to
2
2332
by: msbs48 | last post by:
Hi All very new to Access... having a problem with TransferText I am getting the message "Field 'NoName' doesn't exist in destination table" i saw a previous answer to this but it does not seem to apply here is my code DoCmd.TransferText acImportDelim, , "dbo_CUST_GS_PL", TargetDir + aFileSpec, -1 here is a snipet from the source file it is a csv file( i Know it is not easy to read, but the last column is "Den Curr Code", The field...
0
11232
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10819
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10923
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10462
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8016
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5851
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6045
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4271
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.