<% strModel = Request("Model") strMake = Request("Make") If Request.form <> "" Then if strMake = "" then strWarningErrMsg = "
Vehicle make can not be blank." end if if strModel = "" then strWarningErrMsg = "
Vehicle model can not be blank." end if if strWarningErrMsg = "" then ' Create a recordset object to store specific table information Set conn = Server.CreateObject("ADODB.Recordset") 'Establish what records you want selected for the SQL query string SQL = "Select * From CDModels where (CDModel = '" + strModel + "')" 'Set the recordset object equal to the SQL query string conn.Open SQL, objADO, 1, 3 if not conn.eof then strWarningErrMsg = "Vehicle Model " & strModel & " already exists. Please input another." else conn.addnew conn("CDModel") = strModel conn("MakeId") = strMake Conn.update Response.Redirect "menu.asp" end if end if end if %>
<% if strWarningErrMsg <> "" then %> <% end if %>
ADD VEHICLE MAKE
Error(s):<%= strwarningErrMsg %>


Add the vehicle model below. Each vehicle model must be associated with a vehicle make.
<% Set RS=Server.CreateObject("ADODB.RecordSet") Query = "SELECT * FROM CDMakes ORDER BY CDMake" RS.Open Query, objADO IF (RS.EOF) THEN %> There are no makes in the database! You must first add vehicle makes before a vehicle model can be added.

<% Else %>

<% End If %>
Vehicle Make:    
Vehicle Model: