Prev: Function to Return the Location of the Backend
Next: Assign value based on value field in query
From: Vincent on 13 Aug 2010 12:47 I am using version 12.0.6535.5005 of the msaccess.exe executable on a Windows 7 64-bit computer. Every time I open and exit Access, the GUI will be made invisible, but the process is still running in the background. This occurs even if I do not open any database files-- simply opening msaccess.exe and closing it causes the process to hang. Has anyone else experienced this issue? Does anyone know if there is an update to this issue? Thanks. Vincent
From: Vincent on 13 Aug 2010 14:07 On Aug 13, 12:47 pm, Vincent <animedrea...(a)verizon.net> wrote: > I am using version 12.0.6535.5005 of the msaccess.exe executable on a > Windows 7 64-bit computer. Every time I open and exit Access, the GUI > will be made invisible, but the process is still running in the > background. This occurs even if I do not open any database files-- > simply opening msaccess.exe and closing it causes the process to hang. > > Has anyone else experienced this issue? Does anyone know if there is > an update to this issue? > > Thanks. > > Vincent Okay, I may have been seeing things regarding simply opening the executable. I'm not certain. I am troubleshooting one particular application and if I do not call a particular function, the msaccess.exe exits cleanly. If I do call this function, the msaccess.exe process hangs. The function in question is shown below and the various API declarations are shown as well. Does anyone see an issue with how this is written that would cause msaccess.exe to hang? Thanks. Vincent Private Function EnumerateDatabases() As Boolean On Error GoTo Err_EnumerateDatabases Dim strDBList As String Dim iSearchHandle As Long Dim pFindFileBuff As WIN32_FIND_DATA iSearchHandle = FindFirstFile("v:\*.mdb", pFindFileBuff) If (iSearchHandle <> INVALID_HANDLE_VALUE) Then Do strDBList = strDBList & TrimNull(pFindFileBuff.cFileName) & ";" Loop While (FindNextFile(iSearchHandle, pFindFileBuff)) Close FindClose(iSearchHandle) Me.cmbDB.RowSource = strDBList EnumerateDatabases = True End If Exit_EnumerateDatabases: Exit Function Err_EnumerateDatabases: MsgBox "Error: EnumerateDatabases()" & vbCrLf & Error Resume Exit_EnumerateDatabases End Function Here are the various delcarations: Private Const INVALID_HANDLE_VALUE = -1 Private Declare Function FindFirstFile Lib "Kernel32" Alias "FindFirstFileA" _ (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long Private Declare Function FindNextFile Lib "Kernel32" Alias "FindNextFileA" _ (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long Private Declare Function lstrlenW Lib "Kernel32" _ (ByVal lpString As Long) As Long Private Declare Function FindClose Lib "Kernel32" _ (ByVal hFindFile As Long) As Long Private Type FILETIME dwLowDateTime As Long dwHighDateTime As Long End Type Private 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 * 260 cAlternate As String * 14 End Type
From: Stuart McCall on 13 Aug 2010 17:40 I think the problem lies here: Close FindClose(iSearchHandle) The Close statement is used to close open files. All you actually need is: FindClose iSearchHandle
|
Pages: 1 Prev: Function to Return the Location of the Backend Next: Assign value based on value field in query |