Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 8th, 2004, 06:33 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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)



Code:
 
<% 
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 
    Else 
      Session("PersonID") = rsPersonIDCheck("PersonID") 
    End If 
    rsPersonIDCheck.Close 
    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 
  Next 
  Session("blnValidUser") = True         ' declare that current user is validated 
  Response.Redirect "MenuForRegisteredUsers.asp" 
%>
Reply With Quote
  #2 (permalink)  
Old February 17th, 2004, 07:12 AM
Authorized User
 
Join Date: Dec 2003
Location: Nairobi, N/A, Kenya.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to MAMBONO
Default

I have an old trick of getting rid of this error, try this:rsUsers.Open "Person", 3, 3

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
recordset open error MMJiggy62 Beginning VB 6 2 September 4th, 2006 04:52 PM
Recordset (0x800A0BB9) - ERROR myself Classic ASP Professional 1 August 17th, 2006 12:30 AM
Get the error "ADODB.Recordset error '800a0e7d' " Raymond Classic ASP Databases 2 August 5th, 2006 03:53 PM
Error When Deleting Recordset arimakidd Classic ASP Databases 3 May 22nd, 2006 10:59 AM
Recordset Error malhyp Dreamweaver (all versions) 3 December 21st, 2005 05:06 PM



All times are GMT -4. The time now is 08:34 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.