473,804 Members | 3,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.t xt") 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.TransferT ext acLinkDelim, "header", "yes", "HeaderYES.txt" ,
True
DoCmd.TransferT ext acLinkDelim, "header", "no", "HeaderNO.t xt",
False
Problem
What I don't understand is why the HasFieldNames parameter of
DoCmd.TransferT ext 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 2032

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

Similar topics

0
1360
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 appaccess.DoCmd.TransferText acImportFixed, "ImportSpec", "New Data Load Test", ImportFileName, False
0
1189
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 Boolean Dim LastBD As Integer Dim dbs As Database Dim fileN As String Dim tableN As String
3
12710
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...
3
9426
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
1636
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.
3
2644
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
0
1089
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. Am I missing some sort of setting in the transferText function? DoCmd.TransferText acExportDelim, , "qryDistributionListForExport", strFileName an example: Incorrect:
1
1378
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.  Am I missing some sort of setting in the transferText function? DoCmd.TransferText acExportDelim, , "qryDistributionListForExport", strFileName
2
4746
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 also possible to use the TransferText method with such a specification as an argument. However, it's a complete pain having to save a different specification for every new file format.
0
9708
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10588
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
10085
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...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7623
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
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.