Import .dbf files with long names into Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In attempting to import dBaseIV files into Access, I get an error message
that the Jet DBE can't find the object. The dBaseIV files have long
filenames (Ex; HN021372_ooedr5_1546.dbf) generated by a proprietary program
in a hand-held datalogger. If I rename to eight characters, they import
fine, however I am receiving 150 files per day and the time to manually
rename is too long. Is there a way to get Access to import dBaseIV files
with long names?
 
Not directly. But you could run VBA code in ACCESS that would rename the
files to "short" names.
 
If you are using code to import, you can use the
windows api to look up the short name for each file:

Declare Function GetShortPathName Lib "kernel32" _
Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long

If you have an exceptionally bright windows geek on tap,
you can also re-configure windows so that the file open
dialog shows short names.

(david)
 
Back
Top