Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 February 26th, 2007, 12:55 PM
Friend of Wrox
 
Join Date: Feb 2007
Location: Fleet, , United Kingdom.
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

hey, you could rename your fields in your table to username and password to avoid confusion as to how it goes in the sql statement???

 
Old February 26th, 2007, 08:24 PM
Friend of Wrox
 
Join Date: Feb 2007
Location: Fleet, , United Kingdom.
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

hey, how can i response.redirect to a parent frame?

thanks

 
Old February 26th, 2007, 08:32 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This is the thread that won't die =P Anyway you can't use response.redirect to do this, you have to use some Javascript trickery and a Response.Write():

Dim sJavaScript
sJavaScript = "<script language=javascript>"
sJavaScript = sJavaScript & "parent.frames[n].location.href='page.asp';"
sJavaScript = sJavaScript & "</scr" & "ipt>"

response.write(sJavaScript)

In the line: parent.frames[n].location.href='page.asp'; n is equal to an integer value OR the name of the frame. If using the frame name, surround it in ' '

Also, please post all further questions in the Classic ASP Beginners forum, I wrote this entire reply in .NET and totally forgot we were discussing classic ;]

hth



================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 27th, 2007, 02:16 PM
Authorized User
 
Join Date: Feb 2007
Location: Winnipeg, Manitoba, Canada.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi again.

Well, I took a few days off to try and get my login page working. I found some great articles on the topic, and tried out different approaches to fixing my problem. However, I truly am stumped at this part. I receive an error message that is as follows:

Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'EOF'
/logincode3.asp, line 17

I understand that the EOF has to do with the login info (i think), but I do not understand why it isn't supported.
Below is my code again. I have tried variations of what is there, but none of them work.
Any thoughts?
<%
dim username, password
username=TRIM(Request.Form("Uname"))
password=TRIM(Request.Form("Pass"))

If username <> "" AND password <> "" then
   Dim objConn, sql, rec, dbPath
   dbPath="/db/HockeyCards.mdb"
   set objConn = Server.CreateObject("ADODB.Connection")
  objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(dbPath) & ";"
'Select the record matching the username.
   sql = "SELECT * FROM CustomerList WHERE Uname='"& username & "' AND Pass='" & password & "'"
   response.write(sql)
   'If no match found, EOF is not true.
   if NOT response.EOF then
      Response.Redirect("sorry.asp") 'Change to page redirect to after login
   else
      blankError="Invalid username." 'EOF is true, no match found.
   end if
else
%>
Note: I have tried to "highlight" the line in question.

Now is the only thing that's real.
 
Old February 27th, 2007, 02:29 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

....You don't have a recordset object open. .EOF stands for End Of File and it is how you determine if a Recordset (or datastream) has read to the end of file. The response object does not, in fact, support EOF nor will it contain the data you are looking for in your if statement. The response object has to do with sending data to the browser.

you need to do this:

set rec=Con.execute(sql)
   'If no match found, EOF is not true.
   if NOT rec.EOF then
      Response.Redirect("somepage.asp") 'Change to page redirect to after login
   else
      blankError="Invalid username." 'EOF is true, no match found.
   end if

In this instance you implicity convert the variable rec to a recordset.

I think you will find that that will work for you.

Lastly, as I said to neil please post all further questions in the Classic ASP Beginners forum since this forum is for .NET 1.1.

Thanks.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old April 16th, 2008, 11:47 PM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sahanar
Default

hi,

i am new to asp. problem is i am not able to execute my asp files. i have iis in my system. but inside iis->web sites->empty
i should find default web site inside web sites folder. but that folder is empty.and even ftp sites folder also empty. i do not admin rights. so what i can do to execute my asp files.

Thanks









Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic page creation DyerOppenheimer BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 June 29th, 2009 05:34 PM
delayed login account creation GameGorilla BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 January 22nd, 2008 11:27 PM
Creation of HTML page by C# Somesh C# 1 January 24th, 2007 03:21 PM
Newbie Help. Login to unique login page per user Kainan Classic ASP Professional 10 May 3rd, 2005 07:47 AM
username/password creation of login page in asp undercurrent Classic ASP Basics 3 March 21st, 2005 08:38 PM





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