I am getting the following error:
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.CreateParam eter("UN", adVarChar, adParamInput, 10)
My table is set to text and 10 char
My code is here:
[code=asp]
<%
'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.f orm("username") )
Password = UCase(request.f orm("password") )
RememberMe = request.form("r ememberme")
NewPassword = request.form("n ewpassword")
NewUser = request.form("n ewuser")
SessionID=Sessi on.SessionID
'Creating connection Object
set Conn=server.cre ateobject("ADOD B.Connection")
Conn.Mode = 3
'Creating Recordset Object
'set rs = Server.CreateOb ject("ADODB.Rec ordset")
'Initialising Provider String
connStr = "Provider=Micro soft.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.CreateOb ject("ADODB.Com mand")
Set cmd.ActiveConne ction = Conn
cmd.CommandText = "insert into [user] (UN, PW, ssid) values (?, ?, ?)"
cmd.Parameters. Append cmd.CreateParam eter("UN", adVarChar, adParamInput, 10)
cmd.Parameters. Append cmd.CreateParam eter("PW", adVarChar, adParamInput, 10)
cmd.Parameters. Append cmd.CreateParam eter("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.CreateOb ject("ADODB.Com mand")
Set cmd.ActiveConne ction = 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.Cookie s("UserName")=U serName
Response.Cookie s("Password")=P assword
Response.Cookie s("UserName").E xpires = Now() + 365
Response.Cookie s("Password").E xpires = Now() + 365
Response.Redire ct "basicinfo. asp"
else
'writing cookies temporarily
Response.Cookie s("UserName")=U serName
Response.Cookie s("Password")=P assword
Response.Redire ct "basicinfo. asp"
end if
'If no records retrieved
if rs.BOF and rs.EOF then
Response.Redire ct "Signon.asp?use rname=" & UserName
else
'Closing all database connections
Conn.Close
rs.close
set rs = nothing
set Conn = nothing
end if
else
'Invalid User
Response.Redire ct "Signon.asp?Use rName=blank"
end if
%>[/code]
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.CreateParam eter("UN", adVarChar, adParamInput, 10)
My table is set to text and 10 char
My code is here:
[code=asp]
<%
'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.f orm("username") )
Password = UCase(request.f orm("password") )
RememberMe = request.form("r ememberme")
NewPassword = request.form("n ewpassword")
NewUser = request.form("n ewuser")
SessionID=Sessi on.SessionID
'Creating connection Object
set Conn=server.cre ateobject("ADOD B.Connection")
Conn.Mode = 3
'Creating Recordset Object
'set rs = Server.CreateOb ject("ADODB.Rec ordset")
'Initialising Provider String
connStr = "Provider=Micro soft.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.CreateOb ject("ADODB.Com mand")
Set cmd.ActiveConne ction = Conn
cmd.CommandText = "insert into [user] (UN, PW, ssid) values (?, ?, ?)"
cmd.Parameters. Append cmd.CreateParam eter("UN", adVarChar, adParamInput, 10)
cmd.Parameters. Append cmd.CreateParam eter("PW", adVarChar, adParamInput, 10)
cmd.Parameters. Append cmd.CreateParam eter("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.CreateOb ject("ADODB.Com mand")
Set cmd.ActiveConne ction = 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.Cookie s("UserName")=U serName
Response.Cookie s("Password")=P assword
Response.Cookie s("UserName").E xpires = Now() + 365
Response.Cookie s("Password").E xpires = Now() + 365
Response.Redire ct "basicinfo. asp"
else
'writing cookies temporarily
Response.Cookie s("UserName")=U serName
Response.Cookie s("Password")=P assword
Response.Redire ct "basicinfo. asp"
end if
'If no records retrieved
if rs.BOF and rs.EOF then
Response.Redire ct "Signon.asp?use rname=" & UserName
else
'Closing all database connections
Conn.Close
rs.close
set rs = nothing
set Conn = nothing
end if
else
'Invalid User
Response.Redire ct "Signon.asp?Use rName=blank"
end if
%>[/code]
Comment