Wrox Programmer Forums
Wrox Book Feedback A forum to submit feedback on Wrox books if other forums on P2P have been unable to address your book-specific needs. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Wrox Book Feedback section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 12th, 2004, 01:36 PM
Registered User
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADODB.Recordset error

Hello, Here is my problem. I got the script from the Beginning Active server pages 3.0 book page 661. I get the error below when I click on the submit button of my form:

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/databasetesting/AddUser.asp, line 27

Here is the code. Can you help me fix the script? Does the rest of the script look ok?

(line 27 is where it says rsUsers.Open "Person", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable)

Dim objConn 
Set objConn = Server.CreateObject("ADODB.Connection") 
objConn.Open "registration" 

  If Session("blnValidUser") = True and Session("PersonID") = "" Then 
    Dim rsPersonIDCheck 
    Set rsPersonIDCheck = Server.CreateObject("ADODB.Recordset") 
    Dim strSQL 
    strSQL = "SELECT PersonID FROM Person " & _ 
             "WHERE EMailAddress = '" & Session("EMailAddress") & "';" 
    rsPersonIDCheck.Open strSQL, objConn 
    If rsPersonIDCheck.EOF Then 
      Session("blnValidUser") = False 
      Session("PersonID") = rsPersonIDCheck("PersonID") 
    End If 
    Set rsPersonIDCheck = Nothing 
  End If 

  Dim rsUsers 
  Set rsUsers = Server.CreateObject("ADODB.Recordset") 
  rsUsers.Open "Person", objConn, adOpenForwardOnly, adLockOptimistic, adCmdTable 

  If Session("PersonID") <> "" Then                       ' currently logged-on user 
    rsUsers.Filter = "PersonID = '" & Session("PersonID") & "'"   
  Else                                                                 ' New session 
    rsUsers.Filter = "EMailAddress = '" & Request.Form("email") & "'" & _ 
                     "AND Password = '" & Request.Form("password") & "'" 
    If rsUsers.EOF Then                                             ' User not found 
      rsUsers.AddNew                                         ' ...so add a new record (THIS IS LINE 35) 
'   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 
                                                  ' write personal details to record 
  rsUsers("EMailAddress") = Request.Form("email") 
  rsUsers("Password") = Request.Form("password") 
  rsUsers("FamilyName") = Request.Form("FamilyName") 
  rsUsers("GivenName") = Request.Form("GivenName") 
  rsUsers("StreetAddress1") = Request.Form("Address1") 
  rsUsers("StreetAddress2") = Request.Form("Address2") 
  rsUsers("City") = Request.Form("City") 
  rsUsers("State") = Request.Form("State") 
  rsUsers("PostalCode") = Request.Form("PostalCode") 
  rsUsers("Country") = Request.Form("Country") 
  rsUsers("Active") = True 
  rsUsers("LastLogin") = Now 
  rsUsers.Update                                               ' update the database 

  Dim strName, strValue                                   ' create session variables 
  For each strField in rsUsers.Fields 
    strName = strField.Name 
    strValue = strField.value 
    Session(strName) = strValue 
  Session("blnValidUser") = True         ' declare that current user is validated 
  Response.Redirect "MenuForRegisteredUsers.asp" 
Reply With Quote
  #2 (permalink)  
Old February 12th, 2004, 02:22 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts

Please use this forum, http://p2p.wrox.com/book-beginning-asp-3-0-27/, for beginning asp 3.0 questions.

Reply With Quote
  #3 (permalink)  
Old February 23rd, 2007, 02:37 PM
Registered User
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Unfortunately, your link takes you to a forum list that you can't search to find an answer to this question.

Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.RecordSet -- Error nabeeljohn Classic ASP Professional 10 November 9th, 2006 05:23 AM
ADODB.Recordset error '800a0e78' nancy Classic ASP Databases 6 September 1st, 2004 09:42 AM
ADODB.Recordset error '800a0cb3' klittlejohn SQL Server ASP 2 January 19th, 2004 10:17 PM
ADODB.Recordset error '800a0cb3' jmss66 Classic ASP Databases 1 July 16th, 2003 04:18 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.