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

February 20th, 2007, 04:11 PM
|
|
Friend of Wrox
|
|
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

February 20th, 2007, 04:21 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|
|

February 20th, 2007, 04:26 PM
|
|
Friend of Wrox
|
|
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

February 21st, 2007, 06:18 AM
|
|
Friend of Wrox
|
|
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

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

February 23rd, 2007, 03:26 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
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
================================================== =========
|
|

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

February 23rd, 2007, 03:36 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
|
|
 |