"Jim M" <mandala@rci.rutgers.eduwrote in
news:1157373140.056818.154340@m79g2000cwm.googlegr oups.com:
Quote:
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 upgrading:
>
SELECT tblLocal.BackEndPath
FROM tblLocal
WHERE (((tblLocal.ID)=1));
>
This exports a text file which contains:
>
"BackEndPath"
"Z:\MyDataFile.mdb"
>
When I try to retrieve this with:
>
DoCmd.TransferText acImportDelim, , "qImportBackEndPath",
Local_TxtFileName, 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 qImportBackEndPath;"
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