Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 4th, 2004, 12:15 PM
shuotari shuotari is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 shuotari User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
application.filesearch

I am creating a list of all pdf files in a folder on the LAN that contain the string *SO*.pdf in them. I am then traversing the directory structure and processing the files. What I am running into is that I can only have 652 foundfiles. My index value for i is always 652. After that the program just acts like there are no more entries. Any thoughts? Is there a maximum number of .foundfiles? Can I redimension?

Scott

Set fs = Application.FileSearch
DoCmd.Hourglass True
varReturn = SysCmd(acSysCmdSetStatus, "Processing... ")
With fs
.LookIn = vDefPath
.SearchSubFolders = True
.FileName = "*SO*.pdf"
If .Execute(SortBy:=msoSortbyFileName, SortOrder:=msoSortOrderAscending) > 0 Then
varReturn = SysCmd(acSysCmdSetStatus, "Processing... " & .FoundFiles.Count & " files...")
'MsgBox "There were " & .foundfiles.Count & " file(s) found."
For i = 1 To .FoundFiles.Count
'MsgBox .FoundFiles(i)
vso = getso(.FoundFiles(i))
varReturn = SysCmd(acSysCmdSetStatus, "Processing... " & i & " of " & .FoundFiles.Count & " files...")
If (vso <> "") Then
vSQL = "update serviceorder set SOPath = '" & .FoundFiles(i) & "' where ID = " & vso

Debug.Print vSQL
DoCmd.SetWarnings False
DoCmd.Hourglass True
DoCmd.RunSQL vSQL
DoCmd.Hourglass False
DoCmd.SetWarnings True
End If
Next i
Else
MsgBox "There were no files found in " & vDefPath
End If
End With

Reply With Quote
  #2  
Old August 4th, 2004, 06:40 PM
ineuw ineuw is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 82 ineuw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 30 m 28 sec
Reputation Power: 5
There is no known limit for .filesearch. Have you declared i as Long?

Also, the code is confusing where there is a single quote before the message boxes.

If (vso <> "") should be If (vso <> 0).

Finally, your vSQL statement seems to be wrong. I posted a few minutes ago a note regarding using single quotes because of cross platform compatibility and string data which itself can contain a single quote. This will cause an error when the SQL statement is executed. Also, proper bracketing of SQL parameters is very important.

The inconvenience of using double quotes as = " & Chr(34) & . . . . in SQL statements will pay off. Take it from someone who has been there lots of times.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > application.filesearch


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT