This is partial code of my page1.asp when customer try to push the kit to Done state he is getting following error for some kits
The error is “FILESPIDER FAILED TO RUN” error message Displays .please tell me the what may be the error ?
Case "donekit": 'push the kit to "DONE" state
If objKit.DonePost(intKitNumber, sIDSID) Then
' kit is posted, so add the kit number to the Harvester queue
Set adoCmd = SetupProc("pr_InsertKitPostProcessQueue", connStandard)
AddParam adoCmd, "@KitNumber", adInteger, adParamInput, 0, intKitNumber
adoCmd.Execute
Set adoCmd = Nothing
Set objSpider = new Spider
objSpider.WorkingDirectory = Application("FileDirectory")
If Not objSpider.RunFileSpider(intKitNumber) Then
'alert the user that the file spider didn't run
%>
<script>alert("Error: Unable to run file spider (<%=Err.Description%>).");</script>
<%
End If
Set objSpider = Nothing
I have Runfilespider in Common/general.asp
Class Spider
Private mstrWorkingDirectory
Property Let WorkingDirectory(pstrWorkingDirectory)
mstrWorkingDirectory = Trim(pstrWorkingDirectory)
End Property
'Description: Associates the files for a given component version in a kit.
'Parameters:
' pintKitNumber = Kit Number
'Returns: Boolean
Public Function RunFileSpider(ByVal pintKitNumber)
Dim objKit
Dim rs
Dim strFile
Dim strVersionNum
Dim collFiles
Dim intItem
Dim intFileListID
Dim adoCmd
Dim status
RunFileSpider = False
'check if working directory was specified
If Len(mstrWorkingDirectory) <> 0 Then
'Get all the component path info based on the ReleaseKitID
Set rs = GetComponentPath(pintKitNumber)
Do While Not rs.EOF
'check if the version # is blank
If Trim(rs.Fields("CVFileVersion").Value) = "" Or IsNull(rs.Fields("CVFileVersion").Value) Then
'check if the "version.txt" exist
If IsFileExist(mstrWorkingDirectory & rs.Fields("RelativePath").Value, "version.txt") Then
'get the file context
strFile = GetFileContext(mstrWorkingDirectory & rs.Fields("RelativePath").Value & "\" & "version.txt")
'search for the file version #
strVersionNum = GetVersionNumber(strFile)
End If
'check if the "readme.txt" exist
If IsFileExist(mstrWorkingDirectory & rs.Fields("RelativePath").Value, "readme.txt") Then
'get the file context
strFile = GetFileContext(mstrWorkingDirectory & rs.Fields("RelativePath").Value & "\" & "readme.txt")
'search for the file version #
strVersionNum = GetVersionNumber(strFile)
End If
If Len(strVersionNum) Then 'file version number found
'update the component file version number
UpdateFileVersion rs.Fields("ComponentVersionID").Value, strVersionNum
End If
End If
'get all the associated file(names only) of the current component's relative path
Set collFiles = GetFiles(mstrWorkingDirectory & rs.Fields("RelativePath").Value)
If collFiles.Count > 0 Then 'found the file(s)
For intItem = 0 To collFiles.Length
'check if the filenames already exist in the database
intFileListID = IsFileNameExist(collFiles.Item(intItem))
If intFileListID > 0 Then 'file name exist
'only insert the ReleaseFile ID
InsertFileVersion rs.Fields("ComponentVersionID").Value, rs.Fields("MediaID").Value, _
rs.Fields("ComponentID").Value, collFiles.Item(intItem)
Else 'file name does not exist
'add the file name
InsertFileName rs.Fields("ComponentVersionID").Value, _
rs.Fields("ComponentID").Value, rs.Fields("MediaID").Value, collFiles.Item(intItem)
End If
Next
End If
rs.MoveNext
Loop
End If
Set collFiles = Nothing
Set rs = Nothing
Set objKit = Nothing
RunFileSpider = True
End Function
The error is “FILESPIDER FAILED TO RUN” error message Displays .please tell me the what may be the error ?
Case "donekit": 'push the kit to "DONE" state
If objKit.DonePost(intKitNumber, sIDSID) Then
' kit is posted, so add the kit number to the Harvester queue
Set adoCmd = SetupProc("pr_InsertKitPostProcessQueue", connStandard)
AddParam adoCmd, "@KitNumber", adInteger, adParamInput, 0, intKitNumber
adoCmd.Execute
Set adoCmd = Nothing
Set objSpider = new Spider
objSpider.WorkingDirectory = Application("FileDirectory")
If Not objSpider.RunFileSpider(intKitNumber) Then
'alert the user that the file spider didn't run
%>
<script>alert("Error: Unable to run file spider (<%=Err.Description%>).");</script>
<%
End If
Set objSpider = Nothing
I have Runfilespider in Common/general.asp
Class Spider
Private mstrWorkingDirectory
Property Let WorkingDirectory(pstrWorkingDirectory)
mstrWorkingDirectory = Trim(pstrWorkingDirectory)
End Property
'Description: Associates the files for a given component version in a kit.
'Parameters:
' pintKitNumber = Kit Number
'Returns: Boolean
Public Function RunFileSpider(ByVal pintKitNumber)
Dim objKit
Dim rs
Dim strFile
Dim strVersionNum
Dim collFiles
Dim intItem
Dim intFileListID
Dim adoCmd
Dim status
RunFileSpider = False
'check if working directory was specified
If Len(mstrWorkingDirectory) <> 0 Then
'Get all the component path info based on the ReleaseKitID
Set rs = GetComponentPath(pintKitNumber)
Do While Not rs.EOF
'check if the version # is blank
If Trim(rs.Fields("CVFileVersion").Value) = "" Or IsNull(rs.Fields("CVFileVersion").Value) Then
'check if the "version.txt" exist
If IsFileExist(mstrWorkingDirectory & rs.Fields("RelativePath").Value, "version.txt") Then
'get the file context
strFile = GetFileContext(mstrWorkingDirectory & rs.Fields("RelativePath").Value & "\" & "version.txt")
'search for the file version #
strVersionNum = GetVersionNumber(strFile)
End If
'check if the "readme.txt" exist
If IsFileExist(mstrWorkingDirectory & rs.Fields("RelativePath").Value, "readme.txt") Then
'get the file context
strFile = GetFileContext(mstrWorkingDirectory & rs.Fields("RelativePath").Value & "\" & "readme.txt")
'search for the file version #
strVersionNum = GetVersionNumber(strFile)
End If
If Len(strVersionNum) Then 'file version number found
'update the component file version number
UpdateFileVersion rs.Fields("ComponentVersionID").Value, strVersionNum
End If
End If
'get all the associated file(names only) of the current component's relative path
Set collFiles = GetFiles(mstrWorkingDirectory & rs.Fields("RelativePath").Value)
If collFiles.Count > 0 Then 'found the file(s)
For intItem = 0 To collFiles.Length
'check if the filenames already exist in the database
intFileListID = IsFileNameExist(collFiles.Item(intItem))
If intFileListID > 0 Then 'file name exist
'only insert the ReleaseFile ID
InsertFileVersion rs.Fields("ComponentVersionID").Value, rs.Fields("MediaID").Value, _
rs.Fields("ComponentID").Value, collFiles.Item(intItem)
Else 'file name does not exist
'add the file name
InsertFileName rs.Fields("ComponentVersionID").Value, _
rs.Fields("ComponentID").Value, rs.Fields("MediaID").Value, collFiles.Item(intItem)
End If
Next
End If
rs.MoveNext
Loop
End If
Set collFiles = Nothing
Set rs = Nothing
Set objKit = Nothing
RunFileSpider = True
End Function