Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1173
  • Last Modified:

Application.filesearch - Access Runtime problem

Hi,

In my application, I have the following codes:

Dim  strNotePadFile  as string, ii as interger

With Application.FileSearch
        .LookIn = "C:\"
        .SearchSubFolders = True
        .filename = "Notepad.exe"
       
    If .Execute() > 0 Then
        MsgBox "There were " & .FoundFiles.Count & _
            " file(s) found."
        ii = .FoundFiles.Count
        strNotePadFile = .FoundFiles(ii)           'return the path of the last one found
    Else
        MsgBox "There were no files found."
    End If

End With
       
It works fine in my development computer. However, when I install the application to another computer and runs the application with Access Runtime, the Application.filesearch.execute fails.

how do I fix this?

0
Benita2003
Asked:
Benita2003
2 Solutions
 
wsteegmansCommented:
Can't find any info about it ...
Didn't try your example.

But why not using the traditional way, using Dir or the FileSystemObject?

Take a look here:
http://www.experts-exchange.com/Databases/MS_Access/Q_20367665.html
0
 
nmcdermaidCommented:
Possibly its a reference problem.

Go into Tools/Referencs on the non-development computer and see if there are any missing libraries.
0
 
Benita2003Author Commented:
All the references are there.
Actually, before posting this question, I thought about using Dir but did not try it, and I searched helpfile and find FileSystemObject but it has very little information there and I did not try it either. I wonder why Application.Filesearch is not working with Access Runtime.

I will give them a try and let you guys know.
0
 
wsteegmansCommented:
Check that you have included all DLLs in the run-time library.

In order to check it - in the code window goto Tools->References and see what DLL's or OCX's are checked.

In the line below you will see the source of the file, for example "C:\WINNT\SYSTEM32\form20.dll" and copy the file to run time library.
0
 
ornicarCommented:
----------------------------------------------------------------------------------------
This question has been abandoned and needs to be finalized.
 You can accept an answer, split the points, or get a refund (information at http:/help.jsp#hs5)
  If you need a moderator to help you, post a question at Community Support (http:/Community_Support/)

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ornicar
Cleanup Volunteer

---------------------------------------------------------------------------------------------
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now