473,327 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

ASP Login Page - Not matching up with Access table

Hello,

I have created a login.asp page which i have posted below. When I login into my site, it automatically takes me to the redirect page "index.html" which means that i entered the wrong login information.

I believe i am not connecting to the access table correctly.

Here are some of the characters I used(hope this helps clear up my asp page)

Email --- this is the title to the login column in my access table
Password --- password column title in my table
email --- this is the "name" for the email input text box
password --- this is the "name" for the password input text box
dsn --- access_registration_db.dsn
Access database --- registration.mdb
tablename --- tblRegister

Any thoughts on where I went wrong? Thanks

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Function Login(Email, Password)
  3.  
  4. Dim cn
  5. Dim rs
  6. Dim strSQL
  7. Dim strCn
  8.  
  9. Set cn = CreateObject("ADODB.Connection")
  10. Set rs = CreateObject("ADODB.Recordset")
  11. strSQL = "SELECT * FROM tblRegister WHERE EmailName = '"
  12. strSQL = strSQL & Email & "'"
  13.  
  14. On Error Resume Next
  15. cn.ConnectionString = "DSN=access_registration_db.dsn" & Application("registration.mdb")
  16.  
  17. cn.Open
  18. If Err Then Exit Function
  19.  
  20. rs.Open strSQL, cn
  21. If Err Then Exit Function
  22. If rs("password") = Password Then
  23. Login = True
  24. Else
  25. Login = False
  26. End If
  27. rs.Close
  28. cn.Close
  29. Exit Function
  30. End Function
  31.  
  32. If Login(Request.Form("email"), Request.Form("password")) Then
  33. Response.REdirect "accountpage.html"
  34. Else
  35. Response.Redirect "index.html"
  36. End If
  37. %>
Nov 3 '08 #1
3 1892
sorry for this question, i figured it out. If there is a way to delete my post when i ask a question i figure out before someone else posts, please let me know.
Nov 4 '08 #2
DrBunchman
979 Expert 512MB
Hi Jerry,

Moderators can delete posts but if you've answered your own question it's usually more helpful to reply to your post and let everyone know how you fixed it so that anybody else with the same problem can see how you did it.

Glad you got it sorted,

Dr B
Nov 4 '08 #3
Ok, thanks for your reply.

I was way off on my code i posted above. At least I think i was.

I found a better code to use in a book called Active Server Pages 3.0 By Example.
Nov 4 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: josephrthomas | last post by:
hi..i am trying to make a login page and i am using access table.. when the user enters his userid and password i want to check the password from the table.. if any user with the userID that is...
1
by: Wayne Smith | last post by:
Applies to: Microsoft FrontPage 2000, Microsoft Access 2000, IIS 5.0 Operating System: Microsoft Windows 2000 Professional I am trying to protect a portion of a web site by allowing users to...
3
by: Dam6 | last post by:
Okay... Using vb .net within DW MX2004, connecting to an access database: Background: I have created a simple login.aspx page that is supposed to re-direct to default.aspx using...
1
by: Friends | last post by:
Hi I need to set security for row level but not based on Database user's login. It should be based on the user table login. For the particular user I need to allow only the particular records to...
0
by: muder | last post by:
I have a standard Login ASP.NET 2.0 control on a login Page, a LoginName and LoginStatus controls on the member's page. once the user login successfully I am redirecting the user to Member.aspx...
4
tolkienarda
by: tolkienarda | last post by:
Hi all I work for a small webdesign company and we have remote hosting. i built a mysql database with phpmyadmin on the server. i then downloaded and modified a php login page. i am continuing to...
1
by: xcelmind | last post by:
Hello Dev. Guru, I want to at this time introduce myself. I am Stanley Ojadovwa by name. I’m a freelance and a newbie in web application development. I’m currently using ASP as my application...
10
by: shankhar | last post by:
Hi all, In my project there is a requirement. If a user logged in at a time since he/she logged out others are not allowed to loggin using the same user name. That is to avoid multiple logins...
6
by: =?Utf-8?B?eW9kYWt0?= | last post by:
I'm having issues with logging into my application after moving it from the development server to the live IIS server. Things I've already done: 1) I made sure that I have applicationName set as...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.