473,396 Members | 1,938 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,396 software developers and data experts.

TransferText + Specifications and missing data ...

I have a strange problem linking tab delimited text files in Access 2000
(I am running Windows XP), please try this and let me know if I am going
mad.
Step 1.
Create the tab-delimited text file below in WordPad and call the file
"HeaderYES.txt" (the space between the two fields is actually a tab):-
"Column1" "Column2"
1 "Line1"
2 "Line2"
3 "Line3"
4 "Line4"

Step 2.
Make a copy of "HeaderYES.txt" (called "HeaderNO.txt") and remove (in
WordPad) the first line, you should be left with :-
1 "Line1"
2 "Line2"
3 "Line3"
4 "Line4"

Step 3.
Create a new Microsoft Access database and link in the file
"HeaderYES.txt" using the following parameters :-
Link Text Wizard page 1
- Delimited
Link Text Wizard page 2
- Tab
- First Row Contains Field Names **ON**
- Text Qualifier "
Link Text Wizard page 3
Link Text Wizard page 4
- press the Advance button and SaveAs your Import/Export
specification as "header"
- FINISH
If you open the linked text table HeaderYES you will see that everything
is OK

Step 4.
Now link in HeaderNO.txt using the following parameters :-
Link Text Wizard page 1
- Delimited
- press the Advance button and use the spec called "header"
Link Text Wizard page 2
- Tab
- First Row Contains Field Names **OFF**
- Text Qualifier "
Link Text Wizard page 3
Link Text Wizard page 4
- FINISH
Once again if you look at the table everything seems to work OK

Step 5.
Repeat step 4. BUT do not press the Advance button and select a spec
until page4 of the Wizard. You should see that there is a line missing
from the table.
Conclusion
To me it looks as the Wizard is sensitive as to at which step you
choose your spec file. The safest bet is therefore to always choose your
spec file at the FIRST step of the process, this way any additional
options can be utilized as some of the seem to be RESET when choosing a
spec file.

This is fine now that I know it will happen but what about VB? The two
lines of code produce different tables
DoCmd.TransferText acLinkDelim, "header", "yes", "HeaderYES.txt",
True
DoCmd.TransferText acLinkDelim, "header", "no", "HeaderNO.txt",
False
Problem
What I don't understand is why the HasFieldNames parameter of
DoCmd.TransferText seems to be ignored, the option to have the first row
of a file as fieldnames is not part of the import/export specification.
I would be very grateful is someone could explain this to me. Maybe it
is normal or to be expected or even documented somewhere but I cannot
find it.

I'm sorry if this looks like a long-winded explanation, but it was the
only way I could explain the problem in detail.

Thanks in advance for any help
Also if anyone knows why the CodePage parameter is also ignored in
TransferText, that would also be helpful
------
Sean

"If at first you don't succeed, go to sleep"

*** Sent via Developersdex http://www.developersdex.com ***
Dec 5 '06 #1
0 1990

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

Similar topics

0
by: AndrewB | last post by:
Hi Wondering if anyone can help me with a problem this. I am trying to import a fixed-width text file into Access using code (run through Excel) using the following code ...
0
by: chris | last post by:
Hi, I'm trying to import some text files in a simple access table, but sometimes it miss some rows after import. here is the code: Public Function OpenMyApplicationData() As Boolean Dim Upid As...
3
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...
3
by: Oliver Gabriel | last post by:
Hi, i want to export a table for later import, using vba. That´s my code: export: filename = "C:\HVOtabelle.txt"
0
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...
3
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...
0
by: John Graham | last post by:
I'm using a transferText command on a Query that is joining several tables and pulling data off of a form. However all the fields from the form are coming across as what I believe is Binary data. ...
1
by: John Graham | last post by:
I'm using a transferText command on a Query that is joining several tables and pulling data off of a form.  However all the fields from the form are coming across as what I believe is Binary...
2
by: MIG | last post by:
I am aware that when importing a file it's possible to save a specification that says, for example, treat a particular field as text, whenever importing a file of exactly the same format. It's...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.