Wrox Programmer Forums
|
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 20th, 2007, 04:11 PM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

i see

i have a column in my table called redirect, the pages listed are in the same folder as the asp page but i guess thats not the issue?

all i have to do then is add the "rec" before the column name in the redirect?
do i have to declare redirect anywhere or as its in the db called earlier that will do?

thanks

 
Old February 20th, 2007, 04:21 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No. In this case rec is a recordset, think of a recordset like an array. What rec("redirect") says is retrieve me the value that exists at the "redirect" position.

In this case you dont have to worry about multiple rows because this query should only return 1 row.

================================================== =========
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 20th, 2007, 04:26 PM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

just so you know - the rec(redirect) worked so thanks very much for that, wasnt sure about variables etc so cheers for clearing that up

neil

 
Old February 21st, 2007, 06:18 AM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

Hi,

do you know of a resource or where i can go to read up on protecting certain pages so that the user has to be logged in to view?

Thanks

 
Old February 21st, 2007, 08:56 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Setup some sort of Authentication
http://www.4guysfromrolla.com/webtech/050499-1.shtml
http://www.15seconds.com/issue/981104.htm
http://www.asp101.com/articles/valko...on/default.asp
http://www.tutorialized.com/tutorial...thentication/1
http://www.kamath.com/tutorials/tut003_auth.asp

================================================== =========
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 23rd, 2007, 03:24 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi.
I have been having the same problem.
Thanks for all the advice. It has gotte me much closer to getting it to work. My login screen will finally show up!
However, when I submit the info I get an error saying:
Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/logincode3.asp, line 15

I don't know what is missing! Here is my code (though it will look familiar to what you have posted). It claims the error on the .execute line:

<%
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 & "'"
   Set rec= objConn.execute(sql)
   'If no match found, EOF is not true.
   if NOT rec.EOF then
      Response.Redirect("welcome.asp") 'Change to page redirect to after login
   else
      blankError="Invalid username." 'EOF is true, no match found.
   end if
else
%>

Any thoughts? The taste of victory seems so close now....

Now is the only thing that's real.
 
Old February 23rd, 2007, 03:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

probably a mistype...

sql = "SELECT * FROM Customerlist WHERE Uname='"& username & "' AND Pass='" & password & "'"

should probably be:

sql = "SELECT * FROM Customerlist WHERE Username='"& username & "' AND Pass='" & password & "'"

HTH

Gonzalo

================================================== =========
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 dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old February 23rd, 2007, 03:33 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi.
I'm not sure if that is it. You see, in my form, the fields are named Uname and Pass. Therefore, they need to be named that in the sql statement, right? Also, this is how they are named in the Access table being searched.

Now is the only thing that's real.
 
Old February 23rd, 2007, 03:33 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

check this out
http://www.adopenstatic.com/faq/80040e10.asp

================================================== =========
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 23rd, 2007, 03:36 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Also, try this:

do response.write(sql) does it equate to a SQL statement you can execute inside of access?

================================================== =========
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





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.