On Wed, 19 Sep 2007 14:26:10 +0100, "Keith Wilby" <he**@there.com>
wrote:
I'm assuming you prompt the user for the file by popping up a
File/Open dialog. After it returns with a full path, before attaching
the file, I would use regular file i/o functions like Open, Line Input
etc to test the file.
Alternatively you can go ahead and attach any file, and then use
database queries and/or DAO code to test the data.
Here is one test of the attached table:
if currentdb.tabledefs("MyTextFileTable").Fields.Coun t <10 then
MsgBox "Aarrrccchhh, I was expecting 10 columns", vbCritical
end if
-Tom.
>I've developed an app that allows the user to choose a text file to link to
using the TransferText method. It works fine but I want to mitigate for the
user choosing the wrong file. I thought I'd do this by testing the linked
file for the existance of a certain header (field) name but am not sure what
method/syntax to use.
Any suggestions (other than buy a book)?
Many thanks.
Keith.