Private Declare Function GetShortPathName Lib "kernel32" _
Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Function GetShortName(ByVal sLongFileName As String) As String
'2005/04/15 dlg from MS KB 891176
Dim lRetVal As Long, sShortPathName As String, iLen As Integer
'Set up a buffer area for the API function call return.
sShortPathName = Space(255)
iLen = Len(sShortPathName)
'Call the function.
lRetVal = GetShortPathName(sLongFileName, sShortPathName, iLen)
'Remove unwanted characters.
GetShortName = Left(sShortPathName, lRetVal)
End Function
(david)
<david@epsomdotcomdotau> wrote in message
news:(E-Mail Removed)...
> Use the Windows ShortName API to lookup the
> 8.3 equivalent name, and use that instead.
>
> (david)
>
> "marty" <(E-Mail Removed)> wrote in message
> news
9BE38E3-A81E-4D43-AA6E-(E-Mail Removed)...
>> If you try to move a table from one database to another using the
> following
>> SQL command it will fail with an "Invalid bracketing" error. The problem
>> appears to be that the directory name contains a period followed by a
> space
>> character. When you remove the period or the space it works.
>>
>> SELECT Table1.* INTO Table1 IN 'C:\US. Air\db2.mdb' FROM Table1;
>>
>> Is there some way I can get around this problem so that I don't have to
>> worry about what directory name the user chooses?
>>
>> - marty
>>
>>
>
>