I have a table called Web-Registration-Athletics which has the primary key as StateID. I want to check to see if a new addition StateID is in table - if it is I would like to display a message and not add record
Here is what I have
strSQLExists = "select from "dbo.Web-Registration-Athletics" where StateID='dict(StateID)'"
set rsExists = CreateObject("ADODB.Recordset")
rsExists.Open strSQLExists, dbConnection
if not rsExists.eof then
' if record exists do something
Response.Write "<script>alert('Person is already registered into these games')</script>"
else
' if dont exist do something else
end if
rsExists.Close : set rsExists = Nothing
but I get this when I go to web page
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/SOMNAreas/state/athletics/include/Web_Registration_Athletics_events.asp, line 85
strSQLExists = "select from "dbo.Web-Registration-Athletics" where StateID='dict(StateID)'"
-----------------------------------^
Note sure what I am doing wrong - any help would be greatly appreciated