Solved

Application.filesearch - Access Runtime problem

Posted on 2003-11-20
5
1,131 Views
Last Modified: 2009-07-29
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
Comment
Question by:Benita2003
5 Comments
 
LVL 7

Accepted Solution

by:
wsteegmans earned 170 total points
ID: 9795334
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
 
LVL 30

Assisted Solution

by:nmcdermaid
nmcdermaid earned 80 total points
ID: 9796751
Possibly its a reference problem.

Go into Tools/Referencs on the non-development computer and see if there are any missing libraries.
0
 

Author Comment

by:Benita2003
ID: 9797983
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
 
LVL 7

Expert Comment

by:wsteegmans
ID: 9798249
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
 
LVL 9

Expert Comment

by:ornicar
ID: 10066425
----------------------------------------------------------------------------------------
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now