Ok I am trying to create a function where people can register for an account on my server. But first I want to check and see if the username already exists. Here is the error I am getting and was hoping someone could help out.
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/register.asp, line 80
Here is my code with line 80 noted
<%
If Request.querystring("mode") = "add" then
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("site.mdb")
strUserName = Request.Form("txtUserName")
strUserPass = Request.Form("txtUserPass")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "INSERT INTO tblUsers (username, password) VALUES('" & strUserName & "', '" & strUserPass & "')"
strSQLCheck = "SELECT username from tblUsers WHERE username = " & strUserName
Set rsNewUser = adoCon.Execute(strSQLCheck) --line 80
IF rsNewUser.EOF then
Set rsNewUser = adoCon.Execute(strSQL)
Response.Redirect"start.asp"
End If
'Reset server objects
Set rsNewUser = Nothing
Set adoCon = Nothing
Response.Wrtie ("Username is already taken. Please choose another one.")
End If
%>