Why is it that when I go to import a text file using a file spec that I
either just created on the fly, or one that had existed, no matter what one,
I get the following error message: the text file specification, <specname>
does not exist. You cannot import, export or link using the specification
This happens only in one of many databases I created.
Thanks for any replies
tina - 30 Jul 2007 14:36 GMT
if you're running the import spec using a VBA procedure, try adding the
following code to the beginning of the procedure, as
On Error GoTo Err_Connect
DoCmd.TransferText
then add the following code to the end of the procedure, as
End_Connect:
Exit Function
Err_Connect:
Select Case err.Number
Case 2495
' the TransferText error that "initializes" the saved link
specification.
Resume Next
Case Else
MsgBox err.Number & " - " & err.Description
Resume End_Connect
End Select
i got this tip from here in the newsgroups; i've no idea why it works, but
it does - for me, anyway.
hth
> Why is it that when I go to import a text file using a file spec that I
> either just created on the fly, or one that had existed, no matter what one,
[quoted text clipped - 4 lines]
>
> Thanks for any replies
JonWayn - 31 Jul 2007 05:08 GMT
Well, if all you want to do is suppress the error message, then that works.
As far as importing anything goes, it doesnt. And if you're not doing it in
VBA, you're out of luck.
> if you're running the import spec using a VBA procedure, try adding the
> following code to the beginning of the procedure, as
[quoted text clipped - 32 lines]
> >
> > Thanks for any replies
John Nurick - 31 Jul 2007 05:36 GMT
Searching the newsgroups and the Microsoft site doesn't suggest that
there's a "standard" cause of this problem. One possibility is that
this database has become corrupt; if so, the obvious place for the
problem is in the system tables MSysIMEXSpecs and MSysIMEXColumns
which store the import/export specifications.
These pages have information on likely causes of corruption and what
to do about it:
http://allenbrowne.com/ser-25.html
http://www.granite.ab.ca/access/corruption/causes.htm
One thing I'd try is to create a new database and import everything
from the existing one *except* the import/export specifications.
>Why is it that when I go to import a text file using a file spec that I
>either just created on the fly, or one that had existed, no matter what one,
[quoted text clipped - 4 lines]
>
>Thanks for any replies
--
John Nurick - Access MVP