%
Action = LCase(Request.QueryString)
Set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open("DSN=TwinLights;UID=sa;PWD=sa")
Sub DoHeader(Header)
Response.Write("
| " & Header & " |
")
BGColor="#FFFFFF"
End Sub
If Action="edit" Then
Select Case Request.Form("Submit")
Case "Delete Checked"
For I=1 To Request.Form("ID").Count
Connection.Execute "DELETE FROM Vehicles WHERE ID = " & Request.Form("ID")(I)
Next
Case "Save"
If CInt(Request.Form("ID")) > 0 Then
Connection.Execute "UPDATE Vehicles SET " & _
"LocationID=" & Request.Form("LocationID") & ", " & _
"RONum='" & Request.Form("RONum") & "', " & _
"DateOut = '" & Request.Form("DateOut") & "', " & _
"Vehicle = '" & Request.Form("Vehicle") & "', " & _
"Color = '" & Request.Form("Color") & "', " & _
"Owner = '" & Request.Form("Owner") & "', " & _
"Notes = '" & Request.Form("Notes") & "' WHERE " & _
"ID = " & Request.Form("ID")
Else
Connection.Execute "INSERT INTO Vehicles (" & _
"LocationID, RONum, DateOut, Vehicle, Color, Owner, Notes) VALUES (" & _
Request.Form("LocationID") & ", " & _
"'" & Request.Form("RONum") & "', " & _
"'" & Request.Form("DateOut") & "', " & _
"'" & Request.Form("Vehicle") & "', " & _
"'" & Request.Form("Color") & "', " & _
"'" & Request.Form("Owner") & "', " & _
"'" & Request.Form("Notes") & "')"
End If
'LocationID=rsVehicle("LocationID")
'RONum=rsVehicle("RONum")
'DateOut=rsVehicle("DateOut")
'Vehicle=rsVehicle("Vehicle")
'Color=rsVehicle("Color")
'Owner=rsVehicle("Owner")
'Notes=rsVehicle("Notes")
End Select
End If
Set rsVehicles = Connection.Execute("SELECT Vehicles.*, Locations.LocationName FROM Vehicles, Locations WHERE Vehicles.LocationID=Locations.LocationID ORDER BY Vehicles.LocationID")
%>
history