Why Access suddenly ignores these codes

AccessKid

Registered User.
Local time
Today, 23:39
Joined
Jun 26, 2002
Messages
36
I have a module which contains file functions like exploring the disk to select a folder or to select a file, etc. written by Terry Kreft. It worked well for me for the past three years but suddenly today all of our PCs are exhibiting a similar behavior of doing nothing when the code goes through codes lines which call the functions. For instance there is a function called BrowseFolder which allows the user to pick a folder from the HD by using an explorer-type window. Here's the code for the procedure and related functions that do this:

************code start*************
Code:
Private Type BROWSEINFO
  hOwner As Long
  pidlRoot As Long
  pszDisplayName As String
  lpszTitle As String
  ulFlags As Long
  lpfn As Long
  lParam As Long
  iImage As Long
End Type

Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias _
            "SHGetPathFromIDListA" (ByVal pidl As Long, _
            ByVal pszPath As String) As Long
            
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias _
            "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) _
            As Long
            
Private Const BIF_RETURNONLYFSDIRS = &H1

Public Function BrowseFolder(szDialogTitle As String) As String
  Dim x As Long, bi As BROWSEINFO, dwIList As Long
  Dim szPath As String, wPos As Integer
  
    With bi
        .hOwner = hWndAccessApp
        .lpszTitle = szDialogTitle
        .ulFlags = BIF_RETURNONLYFSDIRS
    End With
    
    dwIList = SHBrowseForFolder(bi)
    szPath = Space$(512)
    x = SHGetPathFromIDList(ByVal dwIList, ByVal szPath)
    
    If x Then
        wPos = InStr(szPath, Chr(0))
        BrowseFolder = Left$(szPath, wPos - 1)
    Else
        BrowseFolder = ""
    End If
End Function

'*********** Code End *****************
 
Last edited by a moderator:
My first thoughts are that the database might be corrupt. Try doing a compact and repair and/or try importing all items into a new database and see if the code works there.

Second, was there any changes to your network just prior to this happening? Maybe some updates to something were applied that messed up something. But, more likely would be the corruption issue.
 
The corruption issue is already ruled out. I have compacted the database already and our LAN Admin guy said there was no LAN-wide updates that he had done in the last 30 days.

But I have a separate installation of the database in another site and I am trying to get a test result from there.
 
Have you tried using the Debugger to isolate a specific instruction which may be causing the problem.
 
llkhoutx said:
Have you tried using the Debugger to isolate a specific instruction which may be causing the problem.

I did and every line executed without error. It's just that the explorer window which is supposed to pop up for the user to select the folder does not appear.
 
ghudson said:
Will my browsing sample work on your computer?

Browse [Find a directory or file]

Thanks for replying. The first two of your browsing forms did not work because I think they are using the same routines which I posted above which also calls on the shell32.dll library. The other two seems to work.

The curious thing is that, in our office, i'm the only one with XP while the rest of the workstations are Wiin2k. But we all have the same problem. I mentioned above that I have another installation of the mdb in another site running on XP also and when I called to check if the system is working there, I was told that it did. So I asked the user to locate and give me the version, date created, inifo of the shell32.dll file and we have exactly the same version, yet it works in her machine but doesn't in mine.

Hmmmm.... this is really getting weird.
 

Users who are viewing this thread

Back
Top Bottom