Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/dcme/newframe/verify.asp, line 48
Line 48 is:
cmd.Parameters.Append cmd.CreateParameter("UN", adVarChar, adParamInput, 10)
My table is set to text and 10 char
My code is here:
Expand|Select|Wrap|Line Numbers
- <%
- 'Connection String
- Dim Conn
- 'Query to be executed
- Dim SQLQuery
- 'Recordset
- Dim rs
- 'UN Of Logged in user
- Dim UserName
- 'PW of User
- Dim Password
- 'Getting information from submitted form
- UserName = UCase(request.form("username"))
- Password = UCase(request.form("password"))
- RememberMe = request.form("rememberme")
- NewPassword = request.form("newpassword")
- NewUser = request.form("newuser")
- SessionID=Session.SessionID
- 'Creating connection Object
- set Conn=server.createobject("ADODB.Connection")
- Conn.Mode = 3
- 'Creating Recordset Object
- 'set rs = Server.CreateObject("ADODB.Recordset")
- 'Initialising Provider String
- connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source="
- connStr = connStr + server.MapPath("db/frame.mdb")
- 'Opening Connection to Database
- Conn.open connStr
- 'If not blank Username password submitted
- if UserName <> "" or Password <> "" then
- 'Recordset and Query to be executed
- rs = "select * from [user] where UN = '"&UserName&"' AND PW = '"&Password&"'"
- 'Retrieving recordset by executing SQL
- 'set rs=Conn.execute(SQLQuery)
- 'If New User selected
- if NewUser = "ON" then
- 'Create Entry
- Set cmd = Server.CreateObject("ADODB.Command")
- Set cmd.ActiveConnection = Conn
- cmd.CommandText = "insert into [user] (UN, PW, ssid) values (?, ?, ?)"
- cmd.Parameters.Append cmd.CreateParameter("UN", adVarChar, adParamInput, 10)
- cmd.Parameters.Append cmd.CreateParameter("PW", adVarChar, adParamInput, 10)
- cmd.Parameters.Append cmd.CreateParameter("ssid", adVarChar, adParamInput, 50)
- cmd.Parameters("UN") = UserName
- cmd.Parameters("PW") = Password
- cmd.Parameters("ssid") = SessionID
- cmd.Execute
- else
- end if
- 'If New Password selected
- if NewPassword = "ON" then
- 'Update Password
- Set cmd = Server.CreateObject("ADODB.Command")
- Set cmd.ActiveConnection = Conn
- cmd.CommandText = "UPDATE user SET PW="& Password &" WHERE UN="+ UserName +""
- cmd.Execute
- else
- end if
- 'If remember me selected
- if RememberMe = "ON" then
- 'Writing cookies permanently
- Response.Cookies("UserName")=UserName
- Response.Cookies("Password")=Password
- Response.Cookies("UserName").Expires = Now() + 365
- Response.Cookies("Password").Expires = Now() + 365
- Response.Redirect "basicinfo.asp"
- else
- 'writing cookies temporarily
- Response.Cookies("UserName")=UserName
- Response.Cookies("Password")=Password
- Response.Redirect "basicinfo.asp"
- end if
- 'If no records retrieved
- if rs.BOF and rs.EOF then
- Response.Redirect "Signon.asp?username=" & UserName
- else
- 'Closing all database connections
- Conn.Close
- rs.close
- set rs = nothing
- set Conn = nothing
- end if
- else
- 'Invalid User
- Response.Redirect "Signon.asp?UserName=blank"
- end if
- %>