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
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