%
' *******************************************************************************
' **
' ** 589 03/07/07 correct restriction of updates to agents and managers (no clients)
' **
' *******************************************************************************
' ***** Initialize Query *****
Dim ConnStr
Dim Conn
Dim rs
Dim SQL
Dim CaseID
Dim RepoLoc
Dim RepoDate
Dim HaveKeys
Dim Property
Dim PoliceID
Dim PoliceNbr
Dim Plate
Dim PoliceOfficer
Dim StorageLoc
Dim StatusID
Dim OverAll
Dim Mileage
Dim strRepoDate
Dim strRepoTime
Dim IsNew
CaseID = Request.QueryString("CaseID")
CaseID = trim(CaseID)
if len(CaseID) > 10 then
showerror("Invalid case number.")
return
end if
' ***************************************
' Connect to Database
' ***************************************
connectdb
If Err.number <> 0 Then
strErrorMsg = strErrorMsg & "305. Error Unable to connect to database.
"
Err.Clear
End If
SQL = "SELECT "
SQL = SQL & "StorageLoc, "
SQL = SQL & "RepoLoc, "
SQL = SQL & "RepoDate, "
SQL = SQL & "HaveKeys, "
SQL = SQL & "Property, "
SQL = SQL & "Plate, "
SQL = SQL & "PoliceID, "
SQL = SQL & "PoliceNbr, "
SQL = SQL & "PoliceCity, "
SQL = SQL & "Status "
SQL = SQL & "FROM tCase "
SQL = SQL & "WHERE CaseID = " & CaseID & " "
' ***** Run Query *****
Set rs = Conn.Execute(SQL)
if Not rs.EOF then
StorageLoc = rs.fields("StorageLoc")
RepoLoc = trim(rs.fields("RepoLoc"))
if isnull(rs.fields("RepoDate")) then
strRepoDate = ""
strRepoTime = ""
else
RepoDate = rs.fields("RepoDate")
if RepoDate < CDate("01/01/1901") then
strRepoDate = ""
strRepoTime = ""
else
strRepoDate = FormatDateTime(rs.fields("RepoDate"),2)
strRepoTime = FormatDateTime(rs.fields("RepoDate"),3)
end if
end if
HaveKeys= rs.fields("HaveKeys")
Property= rs.fields("Property")
PoliceNbr= trim(rs.fields("PoliceNbr"))
PoliceOfficer= trim(rs.fields("PoliceCity"))
StatusID= rs.fields("Status")
PoliceID= rs.fields("PoliceID")
Plate = trim(rs.fields("Plate"))
IsNew = "N"
else
IsNew = "Y"
end if
rs.close
set rs = nothing
SQL = "SELECT "
SQL = SQL & "Overall, "
SQL = SQL & "Mileage "
SQL = SQL & "FROM Condition "
SQL = SQL & "WHERE CaseID = " & CaseID & " "
' ***** Run Query *****
Set rs = Conn.Execute(SQL)
if Not rs.EOF then
Overall = trim(rs.fields("Overall"))
Mileage = rs.fields("Mileage")
end if
rs.close
set rs = nothing
%>