Solved

Application.filesearch - Access Runtime problem

Posted on 2003-11-20
5
1,145 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

821 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