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 | 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 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
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 4th, 2004, 10:31 AM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft VBScript runtime error '800a01a8' object

Hi i am trying to build an updatable profile area for members

but am getting


Microsoft VBScript runtime error '800a01a8'

Object required: '[string: "utown"]'

/myspace/edit_userloc.asp, line 31

when i run this bit of code :

username = Request.cookies("isLoggedInAs")("username")

   town = cstr(Request.form("utown"))
   postcode = cstr(Request.form("upostcode"))
   alerts = cstr(Request.form("alerts"))

   set racDB = Server.CreateObject("ADODB.Connection")
   racDB.Open "rac"


   set insertset = Server.CreateObject("ADODB.RecordSet")
   insertset.Open "memb_loc", racdb, _
   adOpenstatic, adCmdTable

   if p_existing = "" then
   insertset.AddNew
   else

   updateset.Find "username =" &p_existing

    end if

    set town = "utown"
    set postcode = upostcode
    set("alerts") = alerts

    updateset.Update
    updateset.Close
    set insertset = Nothing

    racDB.Close
    set racDB = Nothing

    Response.Clear

 this is the form action i am using

<FORM ACTION="edit_userloc.asp" METHOD = "post">
<TABLE>
Town: <INPUT TYPE="text" NAME="utown" size = "30"
VALUE="<%=town%>"><BR>
Postcode: <INPUT TYPE="text" NAME="upostcode" size = "8"
VALUE="<%=postcode%>"><BR>

                                               <div align="left">Send me

                                               <select name="distance" size="1">
                                                    <option value="1">1</option>
                                                    <option value="2">2</option>
                                                    <option value="3">3</option>
                                                    <option value="4">4</option>
                                                    <option value="5">5</option>
                                                    <option value="6">6</option>
                                                    <option value="7" selected>7</option>
                                                    <option value="8">8</option>
                                                    <option value="9">9</option>
                                                    <option value="10">10</option>
                                                  </select>


                                                   text alerts per week</div>

</TABLE>
<Input TYPE="submit" value = "Update">
</FORM>


please help

Reply With Quote
  #2 (permalink)  
Old June 5th, 2004, 02:00 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

where does line 31 comes in the code?

Check the following code:
updateset.Find "username =" &p_existing


Om Prakash
Reply With Quote
  #3 (permalink)  
Old June 5th, 2004, 05:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Stevesole,

    set town = "utown"
    set postcode = upostcode
    set("alerts") = alerts

what are you trying to do in these three line?

Cheers!

_________________________
-Vijay G
Strive for Perfection
Reply With Quote
  #4 (permalink)  
Old June 5th, 2004, 07:53 AM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am trying to view the previous entries for town postcode and alerts and allow for them to be updated on the database. Line 31 is set town = "utown".
i can send you the complete pages if you think you may want to help?
My email steve_steve476@yahoo.com

Reply With Quote
  #5 (permalink)  
Old June 5th, 2004, 08:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi SteveSole,

I dont see you defining "updateset" anywhere in your code, like you have done for InsertSet

I think you are confusing with the code there.

In the code below I assume that the left part is a recordset object with COLUMN reference set town

and the right part is the value you have retrieved from the FORM "utown"

Code:
    set town = "utown"
    set postcode = upostcode
    set("alerts") = alerts


In the following code, I assume that you Add a new record if profile details does not pre-exist. If it pre-exists then you FIND the exisiting record for which you are using InsertSet and UpdateSet respectively. But you run the Update and Close methods using UPDATESET and setting NOTHING to INSERTSET. How will that work for you?

Code:
if p_existing = "" then
   insertset.AddNew
else
   updateset.Find "username =" &p_existing
end if
    set town = "utown"
    set postcode = upostcode
    set("alerts") = alerts

    updateset.Update
    updateset.Close
    set insertset = Nothing


I think you got to change the code this way.

Code:
if p_existing = "" then
   insertset.AddNew
else
   insertset.Find "username =" &p_existing
end if
    insertset("town") = town
    insertset("postcode") = postcode
    insertset("alerts") = alerts

    insertset.Update
    insertset.Close
    set insertset = Nothing


SET keyword should be used only when you initialize an OBJECT type variable,like this.
set insertset = Server.CreateObject("ADODB.RecordSet")
Cannot be used for assigning a string/int/anyother value to a variable.
Code:
    set town = "utown"
    set postcode = upostcode
    set("alerts") = alerts


This makes sense?
Hope that helps.
Cheers!

_________________________
-Vijay G
Strive for Perfection
Reply With Quote
  #6 (permalink)  
Old June 5th, 2004, 08:29 AM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default


Hi mate
Thanks ever so much for helping me!!
Now i have changed to your code i am getting:

Microsoft VBScript runtime error '800a01a8'

Object required: 'utown'

/myspace/edit_userloc.asp, line 31

Im new to all this as you can see.
I have managewd to get the database adding records but i want a profile page that can be updated and will send an automatic email or sms text message to the user to advise.
If you are interested in helping me more maybe i can offer some money?

are you in India (Bharat?)

i have a yahoo messenger id steve_steve476
if u wanna chat live

cheers

Reply With Quote
  #7 (permalink)  
Old June 5th, 2004, 08:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Stevesolo,

Can you please post the code around line 31? I am unable to locate which could be the line giving you that error.

Sorry, No money please. If you really wanna offer me money then send me -.1000$:D
Yes I am from India;)

Cheers!

_________________________
-Vijay G
Strive for Perfection
Reply With Quote
  #8 (permalink)  
Old June 5th, 2004, 08:44 AM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its nice to meet you!!
 the whole page code is:

edituser_loc.asp

<%@ LANGUAGE="VBSCRIPT" %>
<% Response.buffer = TRUE %>



<%
if isAdmin then

   username = Request.cookies("isLoggedInAs")("username")

   town = cstr(Request.form("utown"))
   postcode = cstr(Request.form("upostcode"))
   alerts = cstr(Request.form("alerts"))

   set racDB = Server.CreateObject("ADODB.Connection")
   racDB.Open "rac"


   set insertset = Server.CreateObject("ADODB.RecordSet")
   insertset.Open "memb_loc", racdb, _
   adOpenstatic, adCmdTable

   if p_existing = "" then
   insertset.AddNew
   else

   updateset.Find "username =" &p_existing

    end if

    set town = utown
    set postcode = upostcode
    set("alerts") = alerts

    updateset.Update
    updateset.Close
    set insertset = Nothing


    Response.Clear

    Response.Redirect "http://localhost/myspace/myspace.asp"
else

    Response.Write "You do not have access to this page."

end if
%>
</BODY>
</HTML>

The whole page code from the form that sends to this page is myspace.asp

<%@ LANGUAGE="VBSCRIPT" %>
<% pageTitle = "mySpace" %>


<h1 align="center">mySpace</h1>

<TABLE width=100%>
<TR><TD VALIGN="top">

<H2>myProfile</H2>
<% if Request.cookies("isLoggedInAs")("username") = "" then
   'user is not logged in, so they don't get to do anything %>

    This area is only for registered members of Rent a Crowd.
    Please <A HREF="login.asp">log in</A>. Thank you!

<% else

    'Get username for use later.
    p_username = Request.cookies("isLoggedInAs")("username")


    set racDB = Server.CreateObject("ADODB.Connection")
    racDB.open "rac"
    set memset = racDB.Execute("select * from members" & " where username = '"&p_username&"'")



    %>Username:<% Response.write memset("username")&"<BR>"
    %>First name:<% Response.write memset("first_name")&"<BR>"
    %>Surname:<% Response.write memset("last_name")&"<BR>"
    %>Email:<% Response.write memset("email")&"<BR>"
    %>Tel Number:<% Response.write memset("telnumber")&"<BR>"

    set memset = racDB.Execute("select * from memb_loc" & " where username = '"&p_username&"'")
    town = memset("town")
    postcode = memset("postcode")
    alerts = memset("alerts")
    p_existing = username

%>
<FORM ACTION="edit_userloc.asp" METHOD = "post">
<TABLE>
Town: <INPUT TYPE="text" NAME="utown" size = "30"
VALUE="<%=town%>"><BR>
Postcode: <INPUT TYPE="text" NAME="upostcode" size = "8"
VALUE="<%=postcode%>"><BR>

                                               <div align="left">Send me

                                               <select name="distance" size="1">
                                                    <option value="1">1</option>
                                                    <option value="2">2</option>
                                                    <option value="3">3</option>
                                                    <option value="4">4</option>
                                                    <option value="5">5</option>
                                                    <option value="6">6</option>
                                                    <option value="7" selected>7</option>
                                                    <option value="8">8</option>
                                                    <option value="9">9</option>
                                                    <option value="10">10</option>
                                                  </select>


                                                   text alerts per week</div>

</TABLE>
<Input TYPE="submit" value = "Update">
</FORM>
<%
    memset.Close

    set memset = nothing



    racDB.close
    set racDB = nothing
    end if %>



</BODY>
</HTML>
I spent 18 months in India travelled all over such a great country!!

Wanna chat via messenger?

Thanks
steve


Reply With Quote
  #9 (permalink)  
Old June 6th, 2004, 04:36 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

From where following recordset is coming?

updateset.Find "username =" &p_existing

I think 'updateset' is not declared above.



Om Prakash
Reply With Quote
  #10 (permalink)  
Old June 7th, 2004, 08:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just an update, this has been solved offline.

Cheers!

_________________________
-Vijay G
Strive for Perfection
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
VBScript runtime error '800a01a8' - FIXED buddyz Classic ASP Databases 2 September 13th, 2006 10:55 AM
Microsoft VBScript runtime error '800a01a8' Abbas Classic ASP Basics 1 July 21st, 2006 11:43 AM
Microsoft VBScript runtime error '800a01a8' Abbas Classic ASP Professional 1 July 21st, 2006 11:42 AM
Microsoft VBScript runtime error '800a01a8' gmoney060 BOOK: Beginning ASP 3.0 1 June 2nd, 2004 01:18 PM
Microsoft VBScript runtime error '800a01a8' dlgee Classic ASP Basics 4 January 25th, 2004 05:18 PM



All times are GMT -4. The time now is 04:03 PM.


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