access 97 and Windows XP

majsparky

Registered User.
Local time
Today, 00:19
Joined
Nov 8, 2003
Messages
21
I have developed and Access 97 application at work that uses .FileSearch in a module. Everything works fine under Windows NT. Our company is making a change-over to Windows XP. When an XP user goes into my application everything works as it should until they try to use the module with the .FileSearch routine. The program gives some non-descript error message and runtime error. I have tried changing references to different classes that have .FileSearch to no avail. Is there a way to keep my same code and have it run under Windows XP
 
Are you using wildcards in your file search? I had a similar problem when I upgraded from
Windows 98 to XP for an old Access 97 db that I inherited. My filesearch function was erroring
because of the * I used in my file search. I had to be more specific and use a different search
parameter. I was lucky that all of my files contained the same key word within the data so I was able
to search for that word within the files data. Here is my code with the before and after changes
so maybe this will help you...

Code:
With Application.FileSearch
    .NewSearch
    .LookIn = "\\Server\Partition\Folder"
    .SearchSubFolders = False
    '.FileName = x '"ABC123.*" 'Old way
    .TextOrProperty = "ABC123"
    '.MatchTextExactly = False 'Old way
    .MatchTextExactly = True
    .FileType = msoFileTypeAllFiles [COLOR=blue]'A reference must be made to the db when selecting this option (for the first time).  Type ".FileType = " (without the quotes) and after you type the =, you will be prompted by Access if you want to add the needed reference.[/COLOR]
    If .Execute() > 0 Then
HTH
 
re: ghudson

Thanks ghudson,

I AM using the Wild Card "*" in the data string search. I am searching for drawings with different revision levels. It is of the form "ABC123" with different revision levels (r00.dwg, r01.dwg,...). If I set the ".TextOrProperty = ABC123" and then set ".MatchTextExactly = False" and ".FileType = dwg" do you think it will work?

Thanks again for your quick response and I will try the code first thing Monday.
 
The method I posted above should work for you as long as each file has the same data "string" within the files data [not the file name]. I was able to search the data within each file because all of my files had the same report name within the data of the files.

That is what these lines are doing...

.TextOrProperty = "ABC123" 'sample of my report name within the files
.MatchTextExactly = True

HTH
 
re: ghudson

I entered the code as you showed and I had to reference Office for the "Filetype =" line. When I ran the code on my Windows NT machine, where the old code ran successfully, the routine just sat there with the Hourglass cursor and churned after about 5 minutes I had to go to the Windows Task Manager and kill the program. I also tried changing the order of the References, but this did not work either.

I thought of trying to use a Do Loop routine and get the same results. However, I am not able to make that work and find all the files. The Do Loop routine seems to work on both Windows NT and XP, however, I am only getting the first file of three from my sample file name.

Any suggestions would be of great benefit.
 
re: ghudson

One other point. In the Object Browser, I was able to local Application.FileSearch , however, .FileSearch is a Hidden Member. Do this have any effect on it not running under Windows XP?
 
re:ghudson

I was able to work with the code and the application now works under Windows NT, XP and 2000. It was as you stated, a problem with using a Wild Card. Thanks again. The code that finally worked is indicated below.

With FileSearch
.LookIn = "L:\Drawings\Acaddwgs\" & d1 & DwgDir
.FileName = DwgName
.FileType = msoFileTypeAllFiles
If .Execute > 1 Then
MsgBox "There were " & .foundfiles.Count & _
" Revision(s) to this Drawing." & Chr(13) & Chr(13) & "Click the OK Button to review the Revision Number(s). " & _
"Determine the Revision you want to use and Add it to the end of the Drawing Number (e.g. 526204008001r01)."
For i = 1 To .foundfiles.Count
MsgBox .foundfiles(i)
Next i
Exit Sub
End If
End With
 

Users who are viewing this thread

Back
Top Bottom