%
strState = Request("State")
strAbbreviation = Request("Abbreviation")
If Request.form <> "" Then
if strState = "" or strAbbreviation = "" then
strWarningErrMsg = "
All fields are required."
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 TblStates where (StateName = '" + strState + "')"
'Set the recordset object equal to the SQL query string
conn.Open SQL, objADO, 1, 3
if not conn.eof then
strWarningErrMsg = "State " & strState & " already exists. Please input another."
else
conn.addnew
conn("StateName") = strState
conn("StateId") = strAbbreviation
Conn.update
Response.Redirect "manageStates.asp"
end if
end if
end if
%>
| ADD A STATE / PROVINCE / TERRITORY | |
| Error(s):<%= strwarningErrMsg %> | |
|
|
|