Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / August 2004

Tip: Looking for answers? Try searching our database.

Importing text and getting 'not a valid path' error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Max Moor - 03 Aug 2004 02:04 GMT
Hi All,

       I'm importing from a text file using an SQL statement:

strSQL = "Insert INTO tblImport (Name, Address) " & _
 SELECT F1 As Name, F2 As Address " & _
 FROM " & strFilename & "#" & strExtension & " " & _
 IN '" & strFullFilename & "' 'Text;'"

where
 strFullFilename = "C:\Documents And Settings\Max Moor\My Documents
\test.txt"

 strFilename = "test"

 strExtension = "txt"

       When I execute the statement, I get an error that the path in not
valid.  The path in the error message is correct, and the file really is
there.  Is there a quirk with the SQL syntax that I'm missing?  Any other
thoughts?

Thanks, Max
Joe Fallon - 03 Aug 2004 03:39 GMT
Not sure, but sometimes Long File Names screw things up.
Try using the short file name for the path.
(6 letters and ~1 are usually correct.)

Documents And ... becomes Docume~1
Signature

Joe Fallon
Access MVP

> Hi All,
>
[quoted text clipped - 19 lines]
>
> Thanks, Max
Max Moor - 03 Aug 2004 04:39 GMT
Hi Joe,
       Thanks for the response.  It turned out that in the SQL statement:

strSQL = "Insert INTO tblImport (Name, Address) " & _
  SELECT F1 As Name, F2 As Address " & _
  FROM " & strFilename & "#" & strExtension & " " & _
  IN '" & strFullFilename & "' 'Text;'"

       where I was using the fully p[athed filename, as strFullFilename, I
should have only been using the path, without the filename.  It works just
fine with that change.  FYI

Max
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.