-1
Dim colResults As New Collection
Dim intI As Integer
Dim objConn As ADODB.Connection
Dim objCmd As ADODB.Command
Dim objRs As ADODB.Recordset
Dim strErrText As String
Dim oField As ADODB.Field
Dim sVal
On Error GoTo RaiseError
Set objConn = New ADODB.Connection
objConn.open DBConnString
Set objCmd = New ADODB.Command
Set objCmd.ActiveConnection = objConn
objCmd.CommandType = adCmdStoredProc
objCmd.CommandText = "spSearchHistory_Read"
objCmd.Parameters(1) = CLng(sUserID)
Set objRs = objCmd.Execute
intI = 1
For Each oField In objRs.fields
If IsNull(oField.Value) Then
'fix null vals so the front end doesnt trip up trying to access them
sVal = ""
Else
If oField.Type = adDBTimeStamp Then
sVal = Format(oField.Value, "dd/mm/yyyy hh:mm")
Else
sVal = oField.Value
End If
End If
colResults.Add sVal, oField.Name
Next
objConn.Close
Set SearchHistory = colResults
Set objRs = Nothing
Set objCmd = Nothing
Set objConn = Nothing
GoTo END_OF_FUNC
RaiseError:
strErrText = "CutomerSearch.SearchHistory" & vbTab & " - " & vbTab & Err.Number & " - " & Err.Description
WriteToLogFile strErrText
WriteToEventLog strErrText
END_OF_FUNC:
@ravindersingh:あなたはそれを通過しましたか? – user3598756