Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 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
 
Old July 24th, 2006, 07:04 AM
Registered User
 
Join Date: Jul 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 15 - Update sql db problem

This may have been answered already, but I couldn't find it. In the AddUser.asp file, everything works fine until it hits the rsUsers.Update line. The only msg that I get returned is The page cannot be displayed. It is connecting to the MS SQL db fine. I have tried opening it with optimistic, dynamic and keyset and I get the same results. Can anyone suggest anything else. Below is my modified code. Thanks.


<%
  Dim rsUsers, intIDForNewRecord, adOpenKeyset, adLockOptimistic, adCmdTable
  adOpenKeyset = 1
  adLockOptimistic = 3
  adCmdTable = &H0002
  Set rsUsers = Server.CreateObject("ADODB.Recordset")
  rsUsers.Open "UserBase", objConn, adOpenKeyset, adLockOptimistic, adCmdTable

  rsUsers.Filter = "Email = '" & Request.Form("Email") & "'"
  If Not rsUsers.EOF Then
    Session("UserExist") = "True"
    Session("Update") = "True"
    Response.Redirect "Register.asp"
  Else
    rsUsers.Filter = 0
    rsUsers.MoveLast
    intIDForNewRecord = rsUsers("UserId") + 1
    rsUsers.AddNew
    rsUsers("UserId") = intIDForNewRecord
    rsUsers("Email") = Request.Form("Email")
    rsUsers("Password") = Request.Form("Password")
    rsUsers("LastName") = Request.Form("LastName")
    rsUsers("FirstName") = Request.Form("FirstName")
    rsUsers("Address1") = Request.Form("Address1")
    rsUsers("Address2") = Request.Form("Address2")
    rsUsers("City") = Request.Form("City")
    rsUsers("State") = Request.Form("State")
    rsUsers("ZipCode") = Request.Form("ZipCode")
    rsUsers.Update
  End If

  Dim strName, strValue For each strField in rsUsers.Fields
    strName = strField.Name
    strValue = strField.value
    Session(strName) = strValue
  Next
  Session("blnValidUser") = True Response.Redirect "Login.asp"
%>
 
Old November 19th, 2006, 06:20 PM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same problem and just through trial and error i added the type lib explain earlier in the book after you i specified the include file.. it goes like this:




this worked for me let me know if it works for you

Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 15 problem golfbird BOOK: Beginning Visual C++ 6 7 September 9th, 2008 12:29 PM
Chapter 15 problem PhilM BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 16 March 10th, 2008 02:46 PM
Chapter 15 Problem rsearing BOOK: Beginning ASP.NET 2.0 and Databases 3 October 12th, 2006 02:59 PM
Chapter 15 15_1 & 15_2 and setting up SQL server a3321889495 BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 July 13th, 2006 06:19 AM
A new chapter 15 problem with BBcodes PhilM BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 September 11th, 2004 11:11 PM





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