BeginnerProgramer
Programmer
Hi Can Anybody help am getting this error
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
And i dont know what it is , here's the code from the 2 files that are involved
----------------------------------------------------
Clssfd.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- META TYPE ="typelib"
File="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<% Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source = C:\Inetpub\If Session("blnValidUser") = True and Session("UserName") = "" Then
Dim rsUserIdCheck
Set rsUserIdCheck = Server.CreateObject ("ADODB.Recordset")
Dim strSql
strSql = "SELECT UserName From tbl_UserId" & _
"WHERE Email = '" & Session ("Email") & "';"
rsUserIdCheck.Open strSql, objConn
If UserIdCheck.EOF Then
Session ("blnValidUser") = False
Else
Session ("UserName") = rsUserIdCheck ("UserName")
End If
rsUserIdCheck.Close
set rsUserIdCheck = Nothing
End If
%>
--------------------------------------------------
AddUser.asp
<!-- #include file="Clssfd.asp" -->
<%
Dim rsUsers
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "tbl_UserId", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
If Session("UserID") <> "" Then ' currently logged-on user
rsUsers.Filter = "UserID = '" & Session("UserID") & "'"
Else ' New session
rsUsers.Filter = "UserName = '" & Request.Form("UserName") & "'" & _
"AND Password = '" & Request.Form("Password") & "'"
If rsUsers.EOF Then ' User not found
rsUsers.AddNew ' ...so add a new record
' Else
' Email address and password matched with DB records -
' In this case we'll allow this to update user's personal details
End If
End If
rsUser ("FirstName") = Request.Form ("FirstName")
rsUser ("Surname") = Request.Form ("Surname")
rsUser ("DOB") = Request.Form ("DOB")
rsUser ("Address1") = Request.Form ("Address1")
rsUser ("Address2") = Request.Form ("Address2")
rsUser ("Address3") = Request.Form ("Address3")
rsUser ("Address4") = Request.Form ("Address4")
rsUser ("PostCode") = Request.Form ("PostCode")
rsUser ("Country") = Request.Form ("Country")
rsUser ("Email") = Request.Form ("Email")
rsUser ("UserName") = Request.Form ("UserName")
rsUser ("Password") = Request.Form ("Password")
rsUser ("Active") = True
rsUser ("LastLogin") = Now
rsUser.Update
Dim strName, strValue
For each strField in rsUser.Fields
strField = strField.Name
strValue = strField.Value
Next
Session ("blnValidUser") = True
Response.Redirect "MenuForRegUsers.asp"
%>
---------------------------------------------
Can anybody see anything wrong with my code
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
And i dont know what it is , here's the code from the 2 files that are involved
----------------------------------------------------
Clssfd.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- META TYPE ="typelib"
File="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<% Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source = C:\Inetpub\If Session("blnValidUser") = True and Session("UserName") = "" Then
Dim rsUserIdCheck
Set rsUserIdCheck = Server.CreateObject ("ADODB.Recordset")
Dim strSql
strSql = "SELECT UserName From tbl_UserId" & _
"WHERE Email = '" & Session ("Email") & "';"
rsUserIdCheck.Open strSql, objConn
If UserIdCheck.EOF Then
Session ("blnValidUser") = False
Else
Session ("UserName") = rsUserIdCheck ("UserName")
End If
rsUserIdCheck.Close
set rsUserIdCheck = Nothing
End If
%>
--------------------------------------------------
AddUser.asp
<!-- #include file="Clssfd.asp" -->
<%
Dim rsUsers
Set rsUsers = Server.CreateObject("ADODB.Recordset")
rsUsers.Open "tbl_UserId", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable
If Session("UserID") <> "" Then ' currently logged-on user
rsUsers.Filter = "UserID = '" & Session("UserID") & "'"
Else ' New session
rsUsers.Filter = "UserName = '" & Request.Form("UserName") & "'" & _
"AND Password = '" & Request.Form("Password") & "'"
If rsUsers.EOF Then ' User not found
rsUsers.AddNew ' ...so add a new record
' Else
' Email address and password matched with DB records -
' In this case we'll allow this to update user's personal details
End If
End If
rsUser ("FirstName") = Request.Form ("FirstName")
rsUser ("Surname") = Request.Form ("Surname")
rsUser ("DOB") = Request.Form ("DOB")
rsUser ("Address1") = Request.Form ("Address1")
rsUser ("Address2") = Request.Form ("Address2")
rsUser ("Address3") = Request.Form ("Address3")
rsUser ("Address4") = Request.Form ("Address4")
rsUser ("PostCode") = Request.Form ("PostCode")
rsUser ("Country") = Request.Form ("Country")
rsUser ("Email") = Request.Form ("Email")
rsUser ("UserName") = Request.Form ("UserName")
rsUser ("Password") = Request.Form ("Password")
rsUser ("Active") = True
rsUser ("LastLogin") = Now
rsUser.Update
Dim strName, strValue
For each strField in rsUser.Fields
strField = strField.Name
strValue = strField.Value
Next
Session ("blnValidUser") = True
Response.Redirect "MenuForRegUsers.asp"
%>
---------------------------------------------
Can anybody see anything wrong with my code