I'm fairly new to ASP and I want to check a form input against my database to see if an entry with the same name already exists and have an if..then and else clause based on this.
I think I'm going about this the wrong way as I get an error when the database doesn't find a match.
Expand|Select|Wrap|Line Numbers
- variable = Request.querystring("formname")
- Set check = MyConn.Execute("select * from table where name='" & variable &"'")
- if check("name")=variable then
- response.write("I'm sorry, but the name you specified - " & check("name") & "already exists")
- else
- call function()
- end if
Any suggestions much appreciated