Filesearch Limitations

G

Guest

I posted this message but made a mistake on the code I'm using. The previous post I made was in error because I defined the variable i as an integer. In reality I am using i as a long, sorry about the mistake.

I can't get the filesearch object to go past 65,530 records. I'm using a long for the number of records to find and seem to get this limitation. This worked fine in Access 97 in Windows NT (168K records). Now with a conversion to 2003 on XP it's not working past the 65,530 records that I mentioned.

This is the code I'm using:

Function load_tifs()

Dim fs As FileSearch
Dim RS As Recordset
Dim i As Long
Dim locn As String
Dim loc1 As String
Dim foundf As String

DoCmd.RunSQL "delete * from TotalOdomInfo;"

Set RS = CurrentDb().OpenRecordset("select * from locationsearch", dbOpenDynaset)

Do While Not RS.EOF

Set fs = Application.FileSearch
loc1 = RS![odomsearch]
With fs
locn = loc1
.LookIn = locn
.SearchSubFolders = True
.FileName = "*.tif"

If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
DoCmd.RunSQL "insert into TotalOdomInfo (image) select " & Chr(34) & (.FoundFiles(i)) & Chr(34) & " as expr1;"

Next i
End If

End With

RS.MoveNext

Loop


End Function
 
T

Tony C

If this working for the first 65,530 records then at first
it would appear as though the code is just fine. Try
declaring i as a Double rather than an Integer or a Long.
If this does not solve the problem then respond to this
posting

HTH

Tony C
-----Original Message-----
I posted this message but made a mistake on the code I'm
using. The previous post I made was in error because I
defined the variable i as an integer. In reality I am
using i as a long, sorry about the mistake.
I can't get the filesearch object to go past 65,530
records. I'm using a long for the number of records to
find and seem to get this limitation. This worked fine
in Access 97 in Windows NT (168K records). Now with a
conversion to 2003 on XP it's not working past the 65,530
records that I mentioned.
This is the code I'm using:

Function load_tifs()

Dim fs As FileSearch
Dim RS As Recordset
Dim i As Long
Dim locn As String
Dim loc1 As String
Dim foundf As String

DoCmd.RunSQL "delete * from TotalOdomInfo;"

Set RS = CurrentDb().OpenRecordset("select * from
locationsearch", dbOpenDynaset)
Do While Not RS.EOF

Set fs = Application.FileSearch
loc1 = RS![odomsearch]
With fs
locn = loc1
.LookIn = locn
.SearchSubFolders = True
.FileName = "*.tif"

If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
DoCmd.RunSQL "insert into
TotalOdomInfo (image) select " & Chr(34) & (.FoundFiles
(i)) & Chr(34) & " as expr1;"
 
G

Guest

Unfortunately, changing i to a Double doesn't change things - I'm still stuck at the 65,530 record limit.

I appreciate your trying to answer this - the code used did work fine in Access 97. Access 2003 is another story.

Tony C said:
If this working for the first 65,530 records then at first
it would appear as though the code is just fine. Try
declaring i as a Double rather than an Integer or a Long.
If this does not solve the problem then respond to this
posting

HTH

Tony C
-----Original Message-----
I posted this message but made a mistake on the code I'm
using. The previous post I made was in error because I
defined the variable i as an integer. In reality I am
using i as a long, sorry about the mistake.
I can't get the filesearch object to go past 65,530
records. I'm using a long for the number of records to
find and seem to get this limitation. This worked fine
in Access 97 in Windows NT (168K records). Now with a
conversion to 2003 on XP it's not working past the 65,530
records that I mentioned.
This is the code I'm using:

Function load_tifs()

Dim fs As FileSearch
Dim RS As Recordset
Dim i As Long
Dim locn As String
Dim loc1 As String
Dim foundf As String

DoCmd.RunSQL "delete * from TotalOdomInfo;"

Set RS = CurrentDb().OpenRecordset("select * from
locationsearch", dbOpenDynaset)
Do While Not RS.EOF

Set fs = Application.FileSearch
loc1 = RS![odomsearch]
With fs
locn = loc1
.LookIn = locn
.SearchSubFolders = True
.FileName = "*.tif"

If .Execute() > 0 Then
For i = 1 To .FoundFiles.Count
DoCmd.RunSQL "insert into
TotalOdomInfo (image) select " & Chr(34) & (.FoundFiles
(i)) & Chr(34) & " as expr1;"
Next i
End If

End With

RS.MoveNext

Loop


End Function


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top