473,850 Members | 2,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Use TransferText to update a field in table?

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.TransferT ext acExportDelim, , "qExportBackEnd Path",
Local_TxtFileNa me, True

qExportBackEndP ath simply pulls the text field 'BackEndPath' from my
tblLocal, which has only one record containing a fields related to
upgrading:

SELECT tblLocal.BackEn dPath
FROM tblLocal
WHERE (((tblLocal.ID) =1));

This exports a text file which contains:

"BackEndPat h"
"Z:\MyDataFile. mdb"

When I try to retrieve this with:

DoCmd.TransferT ext acImportDelim, , "qImportBackEnd Path",
Local_TxtFileNa me, True

I always get a new record in my tblLocal, which is only supposed to
have one record. I've tried a few variations on the query, e.g.
restricting it to (((tblLocal.ID) =1)), but it still adds a record. I
have resorted to 1) creating a temporary table with the transfertext
method, 2) running an update query with it's data to change tblLocal,
3) then deleting the temporary table.

Is there another, more elegant way to do this. Am I barking up the
wrong tree using transferText?

Thanks!
Jim M

Sep 4 '06 #1
3 2647
"Jim M" <ma*****@rci.ru tgers.eduwrote in
news:11******** **************@ m79g2000cwm.goo glegroups.com:
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.TransferT ext acExportDelim, , "qExportBackEnd Path",
Local_TxtFileNa me, True

qExportBackEndP ath simply pulls the text field 'BackEndPath'
from my tblLocal, which has only one record containing a
fields related to upgrading:

SELECT tblLocal.BackEn dPath
FROM tblLocal
WHERE (((tblLocal.ID) =1));

This exports a text file which contains:

"BackEndPat h"
"Z:\MyDataFile. mdb"

When I try to retrieve this with:

DoCmd.TransferT ext acImportDelim, , "qImportBackEnd Path",
Local_TxtFileNa me, True

I always get a new record in my tblLocal, which is only
supposed to have one record. I've tried a few variations on
the query, e.g. restricting it to (((tblLocal.ID) =1)), but it
still adds a record. I have resorted to 1) creating a
temporary table with the transfertext method, 2) running an
update query with it's data to change tblLocal, 3) then
deleting the temporary table.

Is there another, more elegant way to do this. Am I barking up
the wrong tree using transferText?

Thanks!
Jim M
TransferText will always append a new record. Just clear the
existing one before you run the import, Docmd.runsql "delete *
from qImportBackEndP ath;"

You could alternatively open the file using the basic Open() and
get() functions

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Sep 4 '06 #2
Bob, Thanks,

Can you tell me where to find documentation on the Open() and Get()
functions? My AccessXP VBA help is useless...

Jim M

TransferText will always append a new record. Just clear the
existing one before you run the import, Docmd.runsql "delete *
from qImportBackEndP ath;"

You could alternatively open the file using the basic Open() and
get() functions
Sep 6 '06 #3

Jim M wrote:
Bob, Thanks,

Can you tell me where to find documentation on the Open() and Get()
functions? My AccessXP VBA help is useless...

Jim M
try http://www.garybeene.com/vb/tut-file.htm

Anybody else have any suggestions? I learned open() get() put() over 20
years ago.
>
TransferText will always append a new record. Just clear the
existing one before you run the import, Docmd.runsql "delete *
from qImportBackEndP ath;"

You could alternatively open the file using the basic Open() and
get() functions
Sep 6 '06 #4

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

Similar topics

6
3058
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...
3
4375
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
9434
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
1640
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
2331
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
2038
by: Sean Howard | last post by:
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"
4
1845
by: WillMiller | last post by:
Hi, I'm currently attempting to write a small Access Database which carries out the following tasks : 1. Imports Submission files (of a text variety) to a table using TransferText on a daily basis (many files into 1 table) 2. Imports Reject Files files (again of a text variety) to another table using Transfer Text. (again, daily, many files into 1 table) 3. Run a query which reports all submissions that haven't had a matching...
5
2140
by: Dave | last post by:
Hello, I have a possible problem exporting a text field that happens to contain dates (but is not a date field) when using TransferText in MS Access 2000. I am exporting a query to a text file using TransferText in a module. One of my fields is a text field called "invoice description". This field may include any content including dates (e.g., 01/01/2006, 1/1/2006, 01/01/06, Invoice #1, Jan 2006, 293842, etc. are all
7
6032
ollyb303
by: ollyb303 | last post by:
Hi, I am having a bit of a problem with TransferText macro. I am using TransferText, Export Delimited (no field names) to export the results of a query as a .csv file. The query is based on a linked table and uses a CDate() expression to convert the timestamp field (Nom_Date) from the table to a date type and the criteria: Between (Now()-183) And Now() to narrow results to the last 6 months. The query works just fine on its own and...
0
9741
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10666
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
10724
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
10351
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
9503
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...
0
7071
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
5735
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
5929
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4140
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.