Mit der 32 Bit Engine .. hatte ich die Möglichkeit ..Shortpathname und Longpathname zu generieren.. weiß jemand wie ich das Mit Access 2010 64 Bit Versionen wieder zum laufen bringe ?
Siehe Beispiel
Const MAXPATH As Long = 260
Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAXPATH
cAlternate As String * 14
End Type
Declare Function FindFirstFile Lib "kernel32" Alias _
"FindFirstFileA" _
(ByVal lpFileName As String, _
lpFindFileData As WIN32_FIND_DATA) As Long
Declare Function FindClose Lib "kernel32" _
(ByVal hFindFile As Long) As Long
Declare Function GetShortPathName Lib "kernel32" Alias _
"GetShortPathNameA" _
(ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, _
ByVal cchBuffer As Long) As Long
Declare PtrSafe Function ...
Erst mal danke .. für den Tip .. hab aber noch ein Problem bei der Umsetzung ..
hab mal das Bespiel hier ausgeführt ..
Option Compare Database
Const MAXPATH As Long = 260
Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAXPATH
cAlternate As String * 14
End Type
Declare PtrSafe Function Getshortpathname Lib "kernel32" Alias _
"GetShortPathNameA" _
(ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, _
ByVal cchBuffer As Long) As Long
Function GetShortPath(ByVal sLongPath As String) As String
'// -----------------------------------------------------------------
'// Methode: | Ermittelt den 8.3 (DOS)-Pfad
'// -----------------------------------------------------------------
'// Parameter: | sLongPath = gültiger Datei- oder Ordnerpfad
'// -----------------------------------------------------------------
'// Rückgabe: | 8.3 (DOS)-Pfad
'// -----------------------------------------------------------------
Dim sShortPath As String
sShortPath = VBA.String(260, 0)
If Getshortpathname(sLongPath, sShortPath, Len(sShortPath)) Then
GetShortPath = _
VBA.Left(sShortPath, VBA.InStr(sShortPath, vbNullChar) - 1)
End If
End Function
Sub Beispiel()
Dim sLongPath As String
Dim sShortPath As String
sLongPath = "C:\Programme\Microsoft Office\Office10\WINWORD.EXE"
sShortPath = GetShortPath(sLongPath)
MsgBox "Der kurze Pfad lautet: " & sShortPath
End Sub
bekomme aber keinen Wert zurück, vielleicht kannst ju ja mal rüberschaun .. thxs Ozziie alias db4rn