1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Simple Login in ASP using MS Access database

Discussion in 'ASP' started by shabbir, Aug 19, 2006.

  1. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    Just write the set of if's and then Response.Redirect to the correct page unless you have some definite logic for the redirection.
     
  2. biztalk

    biztalk New Member

    Joined:
    Feb 25, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    So you mean like this

    Normal
    'If remember me selected
    if RememberMe = "ON" then
    'Writing cookies permanently
    Response.Cookies("UserName")=UserName
    Response.Cookies("Password")=Password
    Response.Cookies("UserName").Expires = Now() + 365
    Response.Cookies("Password").Expires = Now() + 365
    Response.Redirect "welcome.asp"
    else
    'writing cookies temporarily
    Response.Cookies("UserName")=UserName
    Response.Cookies("Password")=Password
    Response.Redirect "welcome.asp"
    end if

    My version
    'If remember me selected
    if RememberMe = "ON" then
    'Writing cookies permanently
    Response.Cookies("UserName")=test
    Response.Cookies("Password")=test
    Response.Cookies("UserName").Expires = Now() + 365
    Response.Cookies("Password").Expires = Now() + 365
    Response.Redirect "test.asp"
    else
    'writing cookies temporarily
    Response.Cookies("UserName")=test
    Response.Cookies("Password")=test
    Response.Redirect "test.asp"
    end if
     
  3. nednilbor

    nednilbor New Member

    Joined:
    Mar 8, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    do you have any sample code for the signup.asp so that new users could sign up?
     
  4. carrathanatos

    carrathanatos New Member

    Joined:
    Jun 19, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hey, I copy and pasted your code over and created the database with microsoft access, and I keep getting this error:

    HTTP 500.100 - Internal Server Error - ASP error
    Internet Information Services

    Technical Information (for support personnel)

    * Error Type:
    Microsoft JET Database Engine (0x80040E10)
    No value given for one or more required parameters.
    /news/verify.asp, line 37

    * Browser Type:
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0

    * Page:
    POST 45 bytes to /news/verify.asp

    I'm not sure why either...

    thanks for your help,

    melissa
     
  5. carrathanatos

    carrathanatos New Member

    Joined:
    Jun 19, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    biztalk:

    make an extra field in the DB for each user called something like "redirectPage" or something, and then for the redirect where it says:

    Response.Redirect "blah blah blah", replace with:

    Set rsStudent = Server.CreateObject("ADODB.Recordset") 'this should go near the top of your code
    Response.Redirect rsStudent("redirectPage")

    and then at the end be sure to put:

    rsStudent.Close
    set rsStudent = Nothing

    hope that helps! :)
     
  6. carrathanatos

    carrathanatos New Member

    Joined:
    Jun 19, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    (the ifs are too messy, and it's much easier to just include it in our DB.)
     
  7. kseanng

    kseanng New Member

    Joined:
    Jul 3, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hey guys,

    I got this error message.

    The page cannot be displayed
    There is a problem with the page you are trying to reach and it cannot be displayed.

    --------------------------------------------------------------------------------

    Please try the following:

    Click the Refresh button, or try again later.

    Open the fica home page, and then look for links to the information you want.
    HTTP 500.100 - Internal Server Error - ASP error
    Internet Information Services

    --------------------------------------------------------------------------------

    Technical Information (for support personnel)

    Error Type:
    Microsoft JET Database Engine (0x80040E10)
    No value given for one or more required parameters.
    /verify.asp, line 38


    Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)

    Page:
    POST 36 bytes to /verify.asp

    POST Data:
    username=????&password=????&B1=LogIn

    Time:
    Thursday, July 03, 2008, 10:03:38 AM


    More information:
    Microsoft Support
     
  8. carrathanatos

    carrathanatos New Member

    Joined:
    Jun 19, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    If you're suffering the same problem as me, the closest I've been able to get to a pseudo-solution is that the actual CDONTS/CDOSYS cannot send the mail out because the port is being blocked by a firewall of some sort, or that the settings on the server won't allow mail to be sent out.

    I don't have a system admin because they won't hire one, so I'm kind of stuck in cold water.

    I hope you solve yours though....

    oh, just to clarify, if you're having the same problem as me, then it's not a code problem, it's a server problem.
     
  9. XXxxImmortalxxXX

    XXxxImmortalxxXX New Member

    Joined:
    Jun 27, 2007
    Messages:
    569
    Likes Received:
    18
    Trophy Points:
    0
    got a question im looking for some scripts.

    A sql detection script created in asp

    a script to do a forgot password link


    if any of you guys know one can u please post it thanks
     
    Last edited by a moderator: Jul 7, 2008
  10. kseanng

    kseanng New Member

    Joined:
    Jul 3, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
  11. ashley

    ashley New Member

    Joined:
    Nov 24, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    This is a great script!

    I have a database our sales people use. I'd like to restrict their data to their login; ie. username CD from tblLogin can only see data from tblSales salesID=CD.

    Thanks in advance!
     
  12. ashley

    ashley New Member

    Joined:
    Nov 24, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I forgot to post how my tables are set up:

    tblLogin:
    username
    name
    password

    tblSales:
    key
    salesID

    The username from tblLogin will match an entry in salesID, ie. username = CD, salesID = CD.

    The login 'admin' needs to access the entire database.

    I'm new to programming in asp. I think it's an if statement like if username = "", where username=salesID, then... I'm really not sure though!
     
  13. kumaaar

    kumaaar New Member

    Joined:
    Nov 26, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    when i checked the pages its going to the verify page (and showing a blank page of verify )
    even if i do any thing with the login parameters.. pls help is thr any mistake in the code..
     
  14. robinLee01

    robinLee01 New Member

    Joined:
    Feb 23, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    I am new to both microsoft access and asp....but i am trying to lerans ways to link a database and a webpage and saw ur codes....i did as u said in the forum...but i wanst sure what to do next... i mean, i have all the three files in one folder, and what next? how would i check if it worked?
    Thanks in advance
    Robin
     
  15. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    Trying to see them in browsers should be the nest step
     
  16. Ryan_Wilcox

    Ryan_Wilcox New Member

    Joined:
    Jul 27, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi all I need help as I get this error, I am new to asp, and this is for a school assignment.

    Microsoft JET Database Engine error '80040e10'
    No value given for one or more required parameters.
    /students/IPT/12IPT2011/007378/Term 3/verify.asp, line 32

    Here is my code! (These are the code lines around this area of the error)

    'Opening Connection to Database
    Conn.open connStr
    'Query to be executed
    SQLQuery = "select * from tbl_CustomerInfo where Customer_ID = '"&Customer_ID&"' AND Cusotmer_Pass = '"&Password&"'"
    'Retrieving recordset by executing SQL
    set rs=Conn.execute(SQLQuery)
    'If no records retrieved
    if rs.BOF and rs.EOF then
    Response.Redirect "index.asp?Customer_ID=" & Customer_ID
    else
     
  17. Ryan_Wilcox

    Ryan_Wilcox New Member

    Joined:
    Jul 27, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    So sorry for the post, just read over the code myself after getting home, and realised it was a stupid spelling mistake.

    Sorry again.
     

Share This Page