%
strGenre = Request("Genre")
If Request.form <> "" Then
if strGenre = "" 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 TblGenres where (Genre = '" + strGenre + "')"
'Set the recordset object equal to the SQL query string
conn.Open SQL, objADO, 1, 3
if not conn.eof then
strWarningErrMsg = "Genre " & strGenre & " already exists. Please input another."
else
conn.addnew
conn("Genre") = strGenre
Conn.update
Response.Redirect "manageGenres.asp"
end if
end if
end if
%>
| ADD A GENRE | |
| Error(s):<%= strwarningErrMsg %> | |
|
|
|