Library tutorials & articles

Creating a Members Area in ASP

Introduction

A frequent task for ASP developers is to create a members area style section of a website. This would normally involve registration, a login page, and then access to a section of the site that is only available to registered users. This tutorial will cover the steps needed to create all 3 sections, and we'll have lots of fun on the way ;-)

Comments

  1. 02 Sep 2008 at 02:43

    I need this to work with a single username & password, that I set, with no registration necessary. Can this be done?

  2. 13 Aug 2008 at 02:29

    Hello, thanks for the code it really works!

    Actually I´m using SQL Server 2000 and it is possible to register the users with the same user name, and there is not any message that indicate the user exists in the date base. Could you please help me with this!!

    '// ATTENTION: this should be changed depending on the database provider
          If Err.Number = -2147467259 Then
              strError = "- That username is already in use. Please choose another<br>" & vbNewLine
          ElseIf Err.Number <> 0 Then
              strError = "- An error occured. " & Err.Number & " : " & _
    Err.Description & "<br>" & vbNewLine
          Else
              'record created... redirect
              Response.Redirect "login.asp?msg=" & Server.URLEncode("Thank you for registering")
              Response.End
          End If

    Thanks!!

  3. 11 May 2007 at 06:48

    I want to with u a happy day .. And thank's once again for giving us the source code.. but unfortunately i just use your code for my following project but then i got some error said ---The include file 'inc-dbconnection.asp' was not found. Sad [:(]--,  I try to look at your source code pages in the "Creating A Members Area IN ASP" Sad [:(] but i couldnt find one? can you give me the link to copy the file?

    i really need this script for my project!!

     

    Thanks..

    Regards From Shawne Big Smile [:D]

  4. 15 Feb 2007 at 23:35

    Hi, being a bit of a newbee to ASP but am quite up to speed with SQL and some web development. I am struggling a little with getting to grips with what I need to do with some of the code. In the tutorial it says that on the registration form after inputting the html code that we need to put some ASP code in. I am using dreamweaver and have created a basic page and cannot see how I need to add the ASP code, am I answering my own question when I say that I should be creating a dynamic ASP page?

  5. 20 Nov 2006 at 12:39

    If I look at the page in Dreamweaver or similar I also see the code.  However, when it is uploaded to my web server it appears without the code.
    Are you sure your web server can run asp?


  6. 20 Nov 2006 at 12:36

    Hi there
    I'm new to asp and thought i'd start applyinh what I've been reading by using this tutorial. When I attempt to use login.asp or register.asp I receive the following error:

    Microsoft JET Database Engine error '80040e4d'

    Not a valid password.

    /inc-dbconnection.asp, line 12


    I am using an MsAccess 2000 database.
    Does anyone have any clues?

    Nathan





  7. 18 Jun 2006 at 13:29

    Hi, I've never used ASP before and just want to create a members area where I can view the members and their attributes in a simple non-relational database, for my website that is being updated (freebets4all.com).

    Can anyone tell me is this tutorial written for Microsoft Visual Web Developer Expresss Edition as it doesn't seem to follow.

    Where do I write the first bit of ASP code on the preparation page. The closest new file I can create is an aspx file not asp file. Any help regarding this would be appreciated. To help you reply i am 2nd year uni computer science level.

  8. 26 Apr 2006 at 16:55

    I don't understand where the ASP code goes.

  9. 11 Feb 2006 at 18:10

    I really don't understand how to make the register form. Could someone send me their registration form?
    My email is intellistar@gmail.com


    thanks,
    Gil

  10. 12 Aug 2005 at 23:54

    with the registration.asp there seems to be a problem some of the code appears on the page
    "<%=Server.HTMLEncode(Request.Form("username"))%>"
    this code appears on the text box area
    can anyone help on why this is happening?


  11. 16 Jul 2005 at 17:31

    Do you have the following in all of your members pages?


    <%
    If Session("loggedin") <> True Then Response.Redirect "login.asp"
    %>

  12. 16 Jun 2005 at 18:36

    I didn't see anyone posted the problem I had, so I thought I could give some contribution.


    Look at red highlighted word that I had to change in order for it to work:


    '// create the SQL
         strSQL = "SELECT id,password FROM members WHERE id='" & _
            fixQuotes(Request.Form("username")) & "'"


    Everything else seems to work good except I didn't use register.asp just yet.

  13. 12 Jun 2005 at 23:59

    Hello . . . I'm using your script, and it works, but only temporarily.  Once logged in, I get sent back to my login page after a seemingly random sequence and number of clicks through my members only area.  Everything will seem to work well and I can navigate the members area fine.  Then all of a sudden the next click will send me back to the login page.  There's no consistency as to when or where or what link I click on to cause this.  It seems like the session info is being lost.  Have you heard of this before?  What can I do to squash this issue?  Any help would be greatly appreciated!  The code is really good except for this issue.


    Thanks,


    Justin

  14. 16 May 2005 at 12:23

    can anybody help me with the codes on a login/logout session in ASP to SQL database? I'm just a beginner on ASP so im having hard time tackling on the syntax but in logic i think I can handle.. pls....post it here or just e-mail me at karlmarx_37@yahoo.com
    tanx everyone    

  15. 03 Mar 2005 at 15:38

    Have you actually got a field in the database table called username?

  16. 18 Nov 2004 at 06:27

    Hi,


    I'm been think or missing something! Can you please tell me where i create the ASP SCRIPT inc-dbconnection.asp? Is it frontpage or ms access? and what is the ms access script
    Thank you

  17. 11 Nov 2004 at 23:47

    hi guys,


    i have been at this for a few days now. at first i was getting:


    That username is already in use. Please choose another


    then i got smart and read-up on the forums and discovered that i needed to share the folder in which the testdb.mdb file was contained in.
    now i get this new error:


    - An error occured. -2147217900 : The INSERT INTO statement contains the following unknown field name: 'username'. Make sure you have typed the name correctly, and try the operation again


    and this is what i have for that section in the register.asp:


         '// create the SQL
         strSQL = "INSERT INTO members ([username],[password]) VALUES " & _
            "('" & fixQuotes(Request.Form("username")) & "','" & _
            fixQuotes(Request.Form("password")) & "')"
         '// run the SQL
         objConn.Execute strSQL
         '// check for an error
         '// ATTENTION: this should be changed depending on the database provider
         If Err.Number = -2147467259 Then
             strError = "- That username is already in use. Please choose another<br>" & vbNewLine
         ElseIf Err.Number <> 0 Then
             strError = "- An error occured. " & Err.Number & " : " & _
                 Err.Description & "<br>" & vbNewLine




    is there anyone else out there with the same problem or who can help.......


    please help......

  18. 04 Nov 2004 at 05:33

    i used your "creating a members area in ASP" codes but i have a big problem its is that when a user registers in my site, even the username entered is used and alresdy exist in the database table it registers the user and add the username and password in the database. how can i correct this problem pls help me


    an indian  is looking for help pls help me in this matter

  19. 28 Sep 2004 at 07:37

    Hi, I get this screen when I submit the register form:


    Method Not Allowed
    The requested method POST is not allowed for the URL /register.asp.





    Apache/1.3.31 Server at www.asesoresrh.com Port 80


    Can anybody help me?

  20. 03 Sep 2004 at 17:39

    Quote:
    [1]Posted by scuba on 22 Feb 2004 06:52 PM[/1]
    On the registration page, I'm getting this error too...
    I'm using an access database and I know the connection is good becuase I entered an id and pw directly to the db and then used the login.asp page just fine.  I was redirected to the welcome default.asp page.  So I know the error is somewhere in the SQL statement for the register.asp page.  The INSERT INTO statement appears to be having problems with ab Access 2000 database.  


    I commented out a portion of code so I could see the real error message behind the script and it says


    - An error occured. -2147467259 : Operation must use an updateable query.


    Any ideas how to fix this?



    The error detection code doesn't give you the specific problem.  The fix is this: Goto where you have the DB file and change the file permissions to either allow 'Everyone' write+modify, or full access.  The safest bet is to add the 'IUSR_MACHINE' user to the permissions and give it read,write,modify access.


    Works like a charm!

  21. 24 Jul 2004 at 03:06

    Can some1 plz just send me a download file 2 phil99999@hotmail.com and in the download file there must just be the database adn the login and the ahtors files i need plzplz and make it work so if i jsut put then on me site they work

  22. 23 Jul 2004 at 11:38

    i have the same prob how do i make me username uniqe

  23. 23 Jul 2004 at 11:34

    Microsoft JET Database Engine error '80040e10'


    No value given for one or more required parameters.


    /philip/zith/Bruger/login.asp, line 31
    this is a msg when i try to log on whit a user

  24. 23 Jul 2004 at 11:32

    when i try to make a user in the register.asp i get the error msg username already exits why i have tryed more names like jalhgak and i get the same error msg

  25. 15 May 2004 at 18:17

    Here is a way that should work for you.


    <% If Request("r") <> "r" then response.redirect("thesamepage.asp?r=r") %>


    Basicly it looks for the Request("r") if its not there it reloads the page with it.



    Good Luck


    Robert
    HDSS.COM

  26. 07 Mar 2004 at 21:49

    How do I integrate this script in a online book store ?
    I want to create a sample of an online book store for my College project.
    Do you know how I can create such a site ?
    - validate users
    - search for the products
    - Charts
    - simulation of payment through CC

  27. 29 Feb 2004 at 18:56

    I had the same problem when i was linking to a databse in windows using IIS the way i got round this was to share the folder the udatable query problem is usually becase it cannot write to the database this can be because of:


    Read only Access on the database
    (If using IIS) have the dbase in the root folder of your website


    Or change the dir settings to be shared on the folder hope this helps


    Kained

  28. 22 Feb 2004 at 18:52

    On the registration page, I'm getting this error too...
    I'm using an access database and I know the connection is good becuase I entered an id and pw directly to the db and then used the login.asp page just fine.  I was redirected to the welcome default.asp page.  So I know the error is somewhere in the SQL statement for the register.asp page.  The INSERT INTO statement appears to be having problems with ab Access 2000 database.  


    I commented out a portion of code so I could see the real error message behind the script and it says


    - An error occured. -2147467259 : Operation must use an updateable query.


    Any ideas how to fix this?

  29. 10 Feb 2004 at 07:27

    You'll want to add some additional code to the files in the private members area to ensure that the browser does not cache the page:


    http://www.developerfusion.com/show/1010/14/

  30. 10 Feb 2004 at 07:09

    I have the same problem, when using the back button in the browser. Haven't been able to solve it, but then again, I ain't exactly Einstein at this stuff.


    TIA


    -Gate

  31. 21 Jan 2004 at 12:50

    It's working... I got it all figured out.


    Thanks,
    -M

  32. 21 Jan 2004 at 12:14

    As far as I can see, that code should work fine - I assume you're not getting any errors at all?

  33. 21 Jan 2004 at 12:14

    What error occurs, and when?

  34. 24 Dec 2003 at 13:08

    I have attempted to add additional fields but am not sure I am doing it correctly. I am not a Database guru or even an ASP guru for the matter. Can some one point me in the right track? My username and passwords are getting inserted into the DB but the email field is not.
    Thanks,
    -Michael Maxim


    Here is what I have so far:


    You can view my code in a text file at http://www.michaelmaxim.com/regtext.txt

  35. 26 Nov 2003 at 01:20

    i have tried this code , it work perfectly except for the part on the username. i tried entering same username to test the system but however, it didn't show the "the username is already in use" error message Please help. my codes are as follows. Thanks a lot


    <%
    Option Explicit
    Dim strError, strSQL
    'see if the form has been submitted


    If Request.Form("action")="register" Then
      'the form has been submitted
      '// check if compulsory items has been submitted
      If Request.Form("username") = "" Then _
      strError = strError & "<font color=red>Username,</font>"
      If Request.Form("password") = "" Then _
          strError = strError & "<font color=red> Password,</font>"


      'check if the passwords are the same... but don't display it if the password field is blank.
      If Request.Form("password") <> Request.Form("password_confirm") _
          And Request.Form("password") <> "" Then _
              strError = strError & "<font color=red>Your passwords do not match<br></font>" & vbNewLine


      If Request.Form("name") = "" Then _
        strError = strError & "<font color=red> Name,</font>"
      If Request.Form("address") = "" Then _
         strError = strError & "<font color=red> Address,</font>"
      If Request.Form("postcode") = "" Then _
        strError = strError & "<font color=red> Postcode,</font>"
      If Request.Form("city") = "" Then _
         strError = strError & "<font color=red> City,</font>"
      If Request.Form("state") = ""  Then _
        strError = strError & "<font color=red> State,</font>"
     If Request.Form("phone") = "" Then _
         strError = strError & "<font color=red> Phone,</font>"
      If Request.Form("hphone") = ""  Then _
        strError = strError & "<font color=red> Hphone,</font>"
       If Request.Form("email") = ""  Then _
        strError = strError & "<font color=red> Email address</font>"
    '// check if an error has occured
    If strError = "" Then
         'continue
         'include database connection code
         %>
         <!--#include file="connection.inc"-->
         <%
         On Error Resume Next


         '// create the SQL
         strSQL = "INSERT INTO customers ([username],[password],[name],[address],[postcode],[city],[state],[phone],[hphone],[email]) VALUES " & _
            "('" & fixQuotes(Request.Form("username")) &"','"&_
    fixQuotes(Request.Form("password")) & "','" & _
    fixQuotes (Request.Form("name")) &"', '"&_
    fixQuotes(Request.Form("address"))&"','" &_
    fixQuotes(Request.Form("postcode")) & "','"&_
    fixQuotes(Request.Form("city")) & "','" &_
    fixQuotes(Request.Form("state"))&"','"&_
    fixQuotes(Request.Form("phone")) & "','" &_
    fixQuotes(Request.Form("hphone")) & "','" & _
    fixQuotes(Request.Form("email"))&"')"


     '// run the SQL
         objConn.Execute strSQL
         '// check for an error
         '// ATTENTION: this should be changed depending on the database provider
         If Err.Number = -2147467259 Then
             strError = "- That username is already in use. Please choose another<br>" & vbNewLine
         ElseIf Err.Number <> 0 Then
             strError = "- An error occured. " & Err.Number & " : " & _
                 Err.Description & "<br>" & vbNewLine
         Else
             'record created... redirect
             Response.Redirect "login1.asp"
             Response.End
         End If


         'restore standard error handling
         On Error Goto 0


      End If

  36. 29 Oct 2003 at 13:22

    <%@LANGUAGE=VBScript%>
    <% Option Explicit
    Dim strError, strSQL
    IF Request.Form("action")="register" THEN
    ' Form has been submitted


        ' Check username & password
        IF Request.Form("uname")= " " THEN strError = strError & "Please enter a username<BR>" & vbNewLine
        IF Request.Form("pword")= " " THEN strError = strError & "Please enter a password<BR>" & vbNewLine
        IF Request.Form("pword") <> Request.Form("pword_confirm") AND Request.Form("pword") <> " " THEN _
             strError = strError & "Your passwords don't match<BR>" & vbNewLine


        IF strError = " " THEN
             %>
             <!-- #INCLUDE FILE="dbconn.asp" -->
             <%
             ON ERROR RESUME NEXT
             strSQL = "INSERT INTO members ([uname],[pword]) VALUES " & _
                 "(' " & fixQuotes(Request.Form("uname")) & " ', ' " & fixQuotes(Request.Form("pword")) & " ')"
             Conn.Execute strSQL


             If Err.Number = -2147467259 Then
                  strError = "The username you entered is chosen. Please select another.<BR>" & vbNewLine
             ElseIf Err.Number <> 0 Then
                  strError = "Error occured. " & Err.Number & " : " & Err.Description & "<BR>" & vbNewLine
             Else
                  Response.Redirect "login.asp?msg=" & Server.URLEncode("Thank you for your registration with us")
                  Response.End
             End If


             On Error Goto 0
        End If
        If strError <> " " Then
             strError = "<P><FONT COLOR=""#FFOOOO"">Errors occured:" & "</FONT><BR>" & vbNewLine & strError
        End If
    End If


    Function fixQuotes(strData)
        fixQuotes = Replace(strData, " ' ", " ' ' ")
    End Function
    %>


    <HTML>
    <HEAD>
    <TITLE> Free online registration page</TITLE>
    </HEAD>
    <BODY>
    <H1>Member Registration</H1)<BR>
    <P>Please fill out the form to register, and gain access to our members are.</P>


    '<%=strError%>
    <FORM ACTION="register.asp" METHOD="POST">
    <INPUT TYPE="hidden" NAME="action" VALUE="register">
    <TABLE BORDER="1">
    <TR>
        <TD><B>Username</B></TD>
        <TD><INPUT TYPE="text" MAXLENGTH=20 NAME="uname"
       VALUE="<%Server.HTMLEncode(Request.Form("uname"))%>"></TD>
    </TR>
    <TR>
        <TD><B>Password</B></TD>
        <TD><INPUT TYPE="password" MAXLENGTH=20 NAME="pword"
       VALUE="<%Server.HTMLEncode(Request.Form("pword"))%>"></TD>
    </TR>
    <TR>
        <TD><B>Confirm your password</B></TD>
        <TD><INPUT TYPE="password" MAXLENGTH=20 NAME="pwordconfirm"
       VALUE="<%Server.HTMLEncode(Request.Form("pword
    confirm"))%>"></TD>
    </TR>
    <TR>
        <TD></TD>
        <TD><INPUT TYPE="submit" VALUE="Submit Now"></TD>
    </TR>
    </TABLE>
    </FORM>
    </BODY>
    </HTML>

  37. 02 Oct 2003 at 16:24

    I used some of the code in existing web pages of an admin I built.  When I clicked the logout on the admin home page and then hit the browser back button it returned to my admin page showing all the selections.  As far as I can tell the session was terminated because if I chose an action on the admin page, it would redirect to an access denied page because the session was false. Even though the session is terminated, I am still a little concerned since the browser back can return to the page. Should I not worry and "learn to love the bomb"   or is something I can do?


    Thanks,


    James

  38. 16 Jun 2003 at 09:49

    I have fully implemented the code to all my pages, the whole lot works fantasticly. Verify functions correctly, add functions correctly.


    However in order for the "not logged in" redirection function to work correctly you must refresh the page.


    I have also added a name call, the after the verifcation has occured, greets the user by username. BUT


    once again in order for this to work correctly you must refresh the page.


    Likewise the login page, in order for the user to be logged out, the page must be refreshed.


    So the code is correct i would image, but the pages are not loaded from the server on each access of the page.


    I have used meta tags to prevent caching on each page involved ie:
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">    


    I have also tried using this  :


    <%@ Language=VBScript %>
    <%
       response.expires = 0
       response.expiresabsolute = Now() - 1
       response.addHeader "pragma","no-cache"
       response.addHeader "cache-control","private"
       Response.CacheControl = "no-cache"
    %>


    I am using PWS on win98.


    If anyone could help at all it would be most appreciated.. Thanks

  39. 10 Jun 2003 at 23:24

    Hi,


    I have trying to try this code but I get alot of "your username has already been used" and my database is empty!


    Can someone help me out?


    Cheers,
    Iona

  40. 09 Mar 2003 at 04:40

    Just like to say excellent and well thought out tutorial - I have tryed to modify the code so it picks up and stores an email address (normal text field) but have not successfully completed this - can you tel me what code needs to be modified please.


    Best regards,
    Scott Quinn

  41. 02 Mar 2003 at 18:36

    Check the security of your .mdb database.  Make sure that it's not set to read only and that you have full rights assigned to it.  That should do it.  

  42. 18 Feb 2003 at 03:31

    change 222 to the error code you recieved -2147467259 and you should see a user freindly error message


    Hope that Helps!


    the_sleeper

  43. 18 Feb 2003 at 03:23

    I'm a newbie, but I'd probably start by rebuilding the database to include tables which are designed to hold all the information you want to collect. Your questions sound like an app that might be beyond the scope of this article. But that doesnt mean dont try! ;->


    Hope That Helps!


    the_sleeper

  44. 18 Feb 2003 at 03:18

    The App runs fine, EXCEPT for two weird issues..


    1.) When I EXCLUDE the following code, the MEMBERS PAGE loads fine. But, heck, that defeats the purpose of the whole article, eh? But when I INCLUDE the code. It STILL sends me back to login.asp!?!


    <%
    If Session("loggedin") <> True Then Response.Redirect "login.asp"
    %>


    2.) In members.asp there is a "response.redirect" issue. I cannot seem to redirect to another directory in the web OTHER than the root "/" directory



    'redirect to members area
    Response.Redirect ("/members/")



  45. 16 Feb 2003 at 16:37

    Check that you haven't inadvertantly placed any spaces/new line characters before the first <% sign... otherwise ASP will start outputting the page even though we want to redirect...

  46. 16 Feb 2003 at 16:33

    fixQuotes prevents any errors from occuring in our SQL if the user enters a ' in the input fields.

  47. 16 Feb 2003 at 16:31

    The crucial thing missing from your code is the minus sign:


    If Err.Number = -2147217900 Then
    'error...

  48. 13 Feb 2003 at 04:24

    i'm having the exact same problem. were you able to solve it somehow?

  49. 31 Jan 2003 at 11:57

    Hey everyone have the script working with no problems but when it's time to redirect them to the members area to default.asp i'm receiving a 404 - File not found error.


    Does anyone have any idea why or what i can do.

  50. 27 Jan 2003 at 18:25

    How do you change the script so that the user just enters in a username and a password given to them it then gets verified and they are prompted to change there password only one. After all that is complete I would love for that user to view info about them in another accessdb where there records are stored.


    Can Anyone Help Me.


    Thanks

  51. 16 Jan 2003 at 22:01

    Please help i keep having this error when i submit register.asp.
    what can i do????????????? help please
    THIS IS THE ERROR
    Microsoft JET Database Engine error '80004005'


    Operation must use an updateable query.


    /will77/reg/register.asp, line 36



    I use windowsXP and access 2000
    please help
    regards


    tony

  52. 12 Jan 2003 at 14:42

    Hello, I've been able to get the actual code in the register.asp to write to the sql server I created.. but after the user clicks on "Complete Registration" it seems to try and just refresh the register.asp file instead of going to the login.asp page and displaying the "Thank you for registering". Also when it refreshes it gives me a HTTP 500 Server error.  Once I refresh it again it works fine... When I look in the sql db it stores the information.  I'm lost as to why it's not pointing to the login.asp error. Any help would be appreciated.


    Thanks,


    Nathan

  53. 02 Jan 2003 at 12:13

    I was having the same problem as a few of the other people here with the Err.Number 222, I read the posts and replys, set  my username column to Yes - No Duplicates..., changed the Err.Number line in the code to reflect the one I was getting and it's still not recognizing the error.  The problem seems to be that the error number I get seems to be a generic one...2147217900.  I'm using Access 2000 and the Microsoft Jet Error Code is 3022 so I tried using that in the code and it still doesn't work.  Please help me!  I know it's probably something really simple I'm just not seeing.  Here is the error message I get:


    The following errors occured:
    - An error occured. -2147217900 : [Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.


    and here is the code in the register.asp page:


    '// check for an error
         If Err.Number = 2147217900 Then
             strError = "- That username is already in use. Please choose another<br>" & vbNewLine
         ElseIf Err.Number <> 0 Then
             strError = "- An error occured. " & Err.Number & " : " & _
                 Err.Description & "<br>" & vbNewLine
         Else
             'record created... redirect
             Response.Redirect "Mlogin.asp?msg=" & Server.URLEncode("Thank you for registering")
             Response.End
         End If


    Please help

  54. 13 Dec 2002 at 21:29

    you can set a session variable with the following code
    Session("id") = UserID


    Read the Session variable
    Response.Write Session("id")


    Note: some people have session variable/cookies disabled


    Hope that helps, Jono

  55. 13 Dec 2002 at 21:22

    filtering is usually done using a QueryString these are the part in the url after the "?"


    http://www.developerfusion.com/forums/post.aspx?tid=3460
                                                                            ^^^^^^^


    This value can be used from the code
    TopicID = Request.QueryString("tid")


    You use Session Cookies with this code
    Response.Write Session("userid")


    Hope that helps
    Jono

  56. 13 Dec 2002 at 17:45

    this sounds interesting. How do I make sure my cookie is populated and how do I reference it or use in other pages as a variable name? say for filtering the results of a query?? Thanks.

  57. 13 Dec 2002 at 17:31

    This is awesome! I actually got this to work! When I come back from the login.asp I send them to page where I want to display the results of a query against an Access database showing the products they have already bought. I want to pass in the populated username variable from the register.asp page and either run the query when the page loads or run it off a button click. How do I work with the username variable in this and other pages I might redirect them to?? Thanks so much! I have been laboring at this project for weeks before finding your tutorial.

  58. 14 Nov 2002 at 09:17

    I have been using just the login section of your code, and as I have been adding members to the Access database manually it works perfectly - members can log in without any trouble. I have decided to use the full code now so new members can add themselves, but I have been getting this error:


    - An error occured. -2147467259 : Operation must use an updateable query.


    I guess it's something to do with the Accsess database but I don't know much about it. I am using Access from Office XP. Can you please help?


    Thanks  : )

  59. 04 Sep 2002 at 02:15

    i have created members area from your instruction.
    but my database(members) is receiving same usernames.
    So i think 222 error function does not exist . please suggest me.
    and check my script


    222 error function


    If Err.Number = 222 Then
             strError = "- That username is already in use. Please choose another<br>" & vbNewLine
         ElseIf Err.Number <> 0 Then
             strError = "- An error occured. " & Err.Number & " : " & _
                 Err.Description & "<br>" & vbNewLine
         Else
             'record created... redirect
             Response.Redirect "login1.asp?msg=" & Server.URLEncode("Thank you for registering")
             Response.End
         End If


         'restore standard error handling
         On Error Goto 0



                                                                             reply me soon(smruti2002)

  60. 28 Aug 2002 at 21:44

    how the heck do you display details that are unique to each member eg: their email address, their last posts, points they may have acquired etc.  sorry if it may sound like a dumb question but if you could let me know I'd really appreciate it. Thanks, Rich: richardgillian@hotmail.com

  61. 23 Aug 2002 at 03:02

    I have read the code ....but i am not able to understand what this fixQuotes is. I have also designed a code for reg. but i have a problem in that too. The query which I am firing to check wether the user name already exists or not is not taking the appro. action. The problem is that its always going to the same procedure which i have writen in vbscript. Also if the user is reg. for first time. Help me if u can.
    Mail me at aalokcool@yahoo.com

  62. 21 Jul 2002 at 04:44

    I can signup, i've fixed the 222-error but when i try to login i'm getting the following error (in login.asp) :



      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.
      /login.asp, line 31



    Line 31 is:


      Set objRS = objConn.Execute (strSQL)



    So default.asp isn't displayed
    What am i doing wrong?


    Thnx in advance!

  63. 19 Jul 2002 at 17:53

    Microsoft VBScript compilation error '800a0400'


    Expected statement


    inc-dbconnection.asp, line 6


    accessdb = this is the url i link to the database i put here


    Now getting this above error.


  64. 19 Jul 2002 at 13:06

    I don't think the inc-dbconnection.asp is set-up right. I copied it straighr of the page and on to the site (didn't adjut it). I am using an Access 2000 database, which i also uploaded to the same place as the other .asp files.

  65. 16 Jul 2002 at 09:39

    ADODB.Connection.1 error '80004005'


    SQLState: 01S00
    Native Error Code: 0
    SQLState: 08001
    Native Error Code: 0
    [MERANT][ODBC SQL Server Driver]Insufficient information to connect to the data source
    [MERANT][ODBC SQL Server Driver]Invalid connection string attribute



    inc-dbconnection.asp, line 14


    I am getting this error after clicking the submit button on the register page. My datbase is saved as testdb.mdp fill. Is that right? Any ideas woul be great plz.

  66. 10 Jul 2002 at 15:06

    I have set up the members area but when you try to login you get this error

    Code:

    Response object error 'ASP 0156 : 80004005'


    Header Error


    /members/login.asp, line 44


    The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.



    What should i do?

  67. 06 Jun 2002 at 14:18

    Is there another way to display the error message?  


    I want my Window to be of a fixed size (and the text box is in a table). It seems because of this... the str.Err message won't appear.  


    Can I display the str.error message in another text box? something like.... if you had another text box next to the Subject  text box on this screen.


    Thanks,


    Amy-

  68. 04 Jun 2002 at 20:52

    i didnt read all of what GeoRod said but basically the cut down for the problem is that the DATABASE permissions need ot be changed.


    Why does it happen? Well when you open a MDB(Access Format) it creates a tmeporary file(try it your self and you'll see something like lld or something file appaering) so on your webserver you will need to allow the DB to 'create' that file.


    What server is it running?(IIS i guess but never the less) just ask your admin/support team about changeing the permissions on the folder where the location of the DB is located to make sure its got write permission.


    If you have it hosted on local system just right click on teh explorer's folder options and under Security and turn to the relavent field.


    Hope that helps.

  69. 04 Jun 2002 at 15:46



    I believe this is more applicable....
    PRB: ASP Error "The Query Is Not Updateable" When You Update Table Record (Q174640)



    The information in this article applies to:



    Microsoft Active Server Pages
    Microsoft Visual InterDev, versions 1.0 , 6.0
    ActiveX Data Objects (ADO), versions 2.0 , 2.1 SP2 , 2.5 , 2.6 , 2.7
    Microsoft Internet Information Server versions 4.0 , 5.0
    Microsoft Data Access Components versions 2.5 , 2.6 , 2.7






    SYMPTOMS
    One of the following errors occurs when you update a table record from an Active Server Pages (ASP) page through ADO's Recordset.update method:


    Source: Microsoft OLE DB Provider for ODBC Drivers
    Error Number: -2147467259
    Description: The query is not updateable because the from clause is
    not a single simple table name. This may be caused by an attempt to
    update a non-primary table in a view.
    -OR-
    Microsoft OLE DB Provider for ODBC Drivers error '80004005'
    [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name
    '<a column from your table>'.
    /<your asp file>.asp, line xxx
    -OR-
    Microsoft OLE DB Provider for SQL Server '80004005' Cannot insert or update columns from multiple tables.
    -OR-
    Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.




    CAUSE
    The following conditions cause this error to occur:


    You have created a query that contains more than one table.



    You are updating the records returned by this query and the update affects fields in more than one table.



    Basically, if the query involves tables that have a one-to-many relationship, the query -as a whole- is not updateable.




    RESOLUTION
    Process one table's fields independently from another. Issue an Update after each table's fields have been modified. For example, in the code sample below, the "cmdTemp.CommandText" property holds the one-to-many query and the fields of parent table are updated independently of the child table.


      <Object creation code removed for clarity>
                    .
                    .
                    .
      cmdTemp.CommandText = "SELECT stores.state, sales.qty FROM sales INNER
      JOIN stores ON sales.storid = stores.storid"
                    .
                    .
                    .
      'update parent table first
      Datacommand1("state")="WA"
      Datacommand1.update


      'now update child table
      Datacommand1("qty")=4
      Datacommand1.update




    STATUS
    This behavior is by design.




    REFERENCES
    For the latest Knowledge Base artices and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:


    http://support.microsoft.com/support/vinterdev/




    Published Oct 2 1997 7:11PM  Issue Type kbprb  
    Last Modifed Aug 23 2001 8:24AM  Additional Query Words  
    Keywords kberrmsg kbASP kbASPObj kbDatabase kbODBC kbOLEDB kbVisID kbVisID100 kbGrpDSASP kbGrpDSMDAC kbDSupport kbMDAC210SP2 kbMDAC250 kbiis400 kbiis500 kbGrpDSASPDB kbADO250 kbMDAC260 kbADO260 kbATM kbmdac270 kbado270  



  70. 04 Jun 2002 at 15:41



    Look At :
    http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q307640


    SYMPTOMS
    If you try to use a Microsoft Jet (Access) database from multiple instances of the same application either on the same computer or on different computers, you receive the following error message:


    -2147467259 Error ODBC Microsoft Access Driver: The database has been placed in a state by an unknown user that prevents it from being opened or locked.
    This error occurs with both the Microsoft ODBC Driver for Access and the OLE DB Provider for Jet.




    CAUSE
    To run an .mdb file by multiple instances, Jet makes use of a lock delay and retry interval. However, under high load conditions, you may exceed these intervals.




    RESOLUTION
    Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:


    http://www.microsoft.com/partner/referral/
    For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
    http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
    The following workaround extends the retry delay for Jet so that you can use additional instances. However, it is not recommended that you use this workaround if a high number of updates are being formed; this workaround is intended only for reading databases.


    You can add the following sample error handler to your code. Please note that this handler only works with ADO and uses the Sleep function, which you must declare in your general declarations section.
    RetryHandler:
    ' Retry until MAXRETRIES are hit to increment your error count.
    errorcount = errorcount + 1
    If errorcount < MAX
    RETRIES Then
       Randomize 0
    ' Sleep a random amount of time, and retry the same operation.
       Sleep Int(MAXSLEEPINTERVAL * Rnd) + 1
       Resume
    Else
    ' Retries did not help. Show the error, and fall out.
       MsgBox Err.Number & " " & Err.Description
       Exit Sub
    End If




    STATUS
    This behavior is by design.




    MORE INFORMATION
    The above-mentioned workaround is only for read-only mode. Microsoft does not support placing Jet .mdb files under high user load. Microsoft strongly recommends that you use Microsoft SQL Server or Microsoft Data Engine (MSDE) instead of Access when high user loads (that is, more than 15 instances) are required or anticipated, especially when updating is required.




    REFERENCES
    For more information regarding the Sleep function, refer to the MSDN Library documentation.




    Published Oct 2 2001 8:12AM  Issue Type kbprb  
    Last Modifed May 13 2002 6:53AM  Additional Query Words -2147467259  
    Keywords kberrmsg kbGrpDSVBDB kbGrpDSMDAC kbDSupport  




    COMMENTS?

  71. 24 May 2002 at 05:20

    this is a long shot as i dont know nything bout asp, but variable undefined means ure using a


    var = var1


    or something similar, and u havnt statedwhat var is ie, to overcome this in vb i just put


    Dim var


    var = var1


    probably totally out for asp but worth a shot lol

  72. 24 May 2002 at 04:44
    • An error occured. 500 : Variable is undefined


    I am very blank in asp.


    could somebody help me on this???

  73. 13 May 2002 at 10:44

    When i want to add a member to my website on the internet i get the following message,


    The following errors occured:
    - An error occured. -2147467259 : Operation must use an updateable query


    It works nicely when I test it on my computer, but when I publish it to my URL, I get this error.  What can be the problem.


    Sipes

  74. 12 May 2002 at 01:07

    i also forgot to tell you some other things:


    You will need to create the 'FullName' field in the database, and also you will need to insert the session assigning code somewhere in the following code:


    If objRS("password")=Request.Form("password") Then
                  'username/password valid
                  'save session data


    so after the 'Save Session Data' would be an ideal place.

  75. 12 May 2002 at 01:05

    hey,


    simple. I just had a brief look at the Code.


    Heres something you can do:
    Insert a field onto the registration form to get the users name(referenced as here as: 'fullname') then in the register.asp(i think thats teh filename) add:


    sSQL = "INSERT INTO members (username,password,fullname) VALUES " & _
      "('" & fixQuotes(Request.Form("username")) & "','" & _
      "('" & fixQuotes(Request.Form("password")) & "','" & _
      fixQuotes(Request.Form("fullname")) & "')"


    then load the fullname into a session variable like this:
    Session("fullname")= objRS("fullname")



    then you can add a simple ASP retrieve statement to retrieve the name inserted into the field anyhwere on the site like this:


    Welcome <%= Session("fullname")%>


    Hope that Helps!

  76. 11 May 2002 at 18:03

    Hi James,
    I am not a programmer. I have been studying ASP for less than one year. I guess you are talking about the databank, whemn you mention colum constraining. I will look into that. Thanks a lot.



    Some minutes later... I changed the properties of username column. I got it. I just had to change the erro number to show the right message. Instead of 222 I used the number that appeared on my screen: -2147467259 ( it  looks more like an international phone number... anyway... I hope this isn't just that session number.)
    Thanks again.

  77. 11 May 2002 at 10:00

    Thank you for all of your help!  It works great.


    I would like to add the users name to the Memebers (default asp) page.  So it reads Welcome Who ever to the members area


    How can I do that?


    Thanks

  78. 09 May 2002 at 15:38

    The


    If Err.Number = 222 Then


    line.... it may not be error 222 for access .... just try to create a duplicate username and see what error # occurs

  79. 09 May 2002 at 15:04

    Are you talking about changing the acess error number Or the error number in the asp form?
    How do I, in Access, change the error number that the code traps?  
    Or
    Is there another way to set the unique constraint in access?


    Sorry for all of the questions.

  80. 09 May 2002 at 14:03

    yep; no duplicates will be fine. In access, you may also have to change the error number that the code traps

  81. 09 May 2002 at 13:50

    ??


    Do I create this unique constraint in the Design view of the database? And,if so, will changing the "INDEXED" to Yes - no duplicates solve the problem?


    Is that all I hvae to do or is there more to it than that?


    Thanks

  82. 09 May 2002 at 13:37

    No, I didn't even think of that.


    Thanks

  83. 09 May 2002 at 13:08

    have you created a unique constraint for the username column?

  84. 09 May 2002 at 13:08

    have you created a unique constraint on the username field? (in the database)

  85. 09 May 2002 at 10:02

    Same here. It works fine but it accepts and sends to db multiple passwords for the same user, even though it uses just the first password to give access to restricted area. The problem is that users don't even know why their password won't be valid (if they registered with a previously registered password).

  86. 09 May 2002 at 09:25

    Almost everything seems to work except the Err.Number 222


    If I attempt to create a user name that already exists in the database, it is accepted It seems like the Err.Number 222 script is being skipped?


  87. 09 May 2002 at 09:20

    It is now working and I didn't change anything.  I no longer receive the MS Jet error.


    Thanks

  88. 08 May 2002 at 13:11

    no problem... what's the exact error you are receiving?


  89. 08 May 2002 at 11:36

    Sorry about yesterday


    I am getting an error after I hit submit. The error is in the inc-dbconnection.asp line 4 (Microsoft Jet error )


    What have I done wrong and can you help me?


    Thank you
    Amy



  90. 02 May 2002 at 10:38

    have you created a constraint in the database on the username field that only allows unique usernames?

  91. 02 May 2002 at 10:38

    have you created a constraint in the database on the username field that only allows unique usernames?

  92. 21 Apr 2002 at 19:02

    I am able to get a user with the same username.  According to error 222, they are supposed to be prompted to enter a new one, this is not occuring.  PLease help

  93. 21 Apr 2002 at 19:02

    I am able to get a user with the same username.  According to error 222, they are supposed to be prompted to enter a new one, this is not occuring.  PLease help

  94. 21 Apr 2002 at 18:23

    I am having a problem updating the database I get an error:


    - An error occured. -2147217900 : Number of query values and destination fields are not the same.


    what is the problem here?




    strSQL = "INSERT INTO Personal ([username],[Password],[FName],[LName],[Street],[City],[State],[Zip],[Phone],[Birthdate]) VALUES " & _
            "('" & fixQuotes(Request.Form("username")) & "','" & _
            fixQuotes(Request.Form("Password")) & "','" & _    
            fixQuotes(Request.Form("Fname")) & "','" & _
            fixQuotes(Request.Form("LName")) & "','" & _    
            fixQuotes(Request.Form("Street")) & "','" & _    
            fixQuotes(Request.Form("City")) & "','" & _    
            fixQuotes(Request.Form("State")) & "','" & _    
            fixQuotes(Request.Form("Zip")) & "','" & _    
            fixQuotes(Request.Form("Phone")) & "','" & _    
            fixQuotes(Request.Form("Birthdate")) & "','" & "')"
           

  95. 21 Apr 2002 at 18:23

    I am having a problem updating the database I get an error:


    - An error occured. -2147217900 : Number of query values and destination fields are not the same.


    what is the problem here?




    strSQL = "INSERT INTO Personal ([username],[Password],[FName],[LName],[Street],[City],[State],[Zip],[Phone],[Birthdate]) VALUES " & _
            "('" & fixQuotes(Request.Form("username")) & "','" & _
            fixQuotes(Request.Form("Password")) & "','" & _    
            fixQuotes(Request.Form("Fname")) & "','" & _
            fixQuotes(Request.Form("LName")) & "','" & _    
            fixQuotes(Request.Form("Street")) & "','" & _    
            fixQuotes(Request.Form("City")) & "','" & _    
            fixQuotes(Request.Form("State")) & "','" & _    
            fixQuotes(Request.Form("Zip")) & "','" & _    
            fixQuotes(Request.Form("Phone")) & "','" & _    
            fixQuotes(Request.Form("Birthdate")) & "','" & "')"
           

  96. 13 Mar 2002 at 02:01

    There is a great reference for ado connections in general which includes sample connection types in access www.able-consulting.com/ADO_Conn.htm

  97. 06 Mar 2002 at 10:09

    Sorry... only just got to your post. Can I just ask what the problem was? Was it a problem with the article, or something at your end?

  98. 06 Mar 2002 at 09:37

    I know that no 1 has replied any way but i would just like to inform every 1 that there is no need to reply to my above message as i have rectified the problem..




    Thank You

  99. 01 Mar 2002 at 14:07

    I am unable to run the login code, i seem to retrieve an unusual error.
    This occurs from the line of code
    If Request.Form("username") = "" Then _strError = strError & "- Please enter a username<br>" & vbNewLine Microsoft VBScript compilation (0x800A0408)
    Invalid character line 8

    however i am sure that the problem comes from the line above with this line of code:
    If Request.Form("action")="login" Then
    i believe this because if a put a comment in place of the line of code that generates an error, and move that line down i will then receive the error from the commented code


    PS could it be because i have a global asa, running in the same directory and that i have used IISManager to create an application oif that directory ??


    Please could some-one reply to me  

  100. 01 Mar 2002 at 12:54

    i Too am using an access database.
    I found that it is firstly better to connect using ODBC,
    Then make sure the the name you are giving to connect is exactly the same as the ODBC driver name not neccesarly the database name
    e.g of the code that works 4 me, this puts all resords and siplays in a table

    Dim adoCon        'Holds the DB connection Object
    Dim rsRecords    'Holds the recordSet for the records in the DB
    Dim strSQL        'Holds the SQL query 2 query the DB


    'Creating the ADO connection object
    Set adoCon = Server.CreateObject("ADODB.Connection")
    'Opening the connection to the DB using DSN connection
    adoCon.Open "DSN=yr6021" ' THIS IS THE NAME OF MY DB, SOCHANGE IT TO YOURS
    'Opening an ADO recordset object
    Set rsRecords = Server.CreateObject ("ADODB.Recordset")
    'Intitialising the strSQL var with an SQL statement
    strSQL = "SELECT * FROM amanihmetest1;" 'amanihmetable1.UserID, amanihme.userName, amanihmetable1.password FROM amanihme;" 'AMANIHMETST1 IS THE NAME OF MY TABLE SO U MUST CHANGE


    'now i can open the recordSet with what is in the the SQL variable
    rsRecords.Open  strSQL, adoCon


    'producing the results
    'loop
    Response.Write "<TABLE BORDER=1 CELLSPACING=3 CELLPADDING=1 >" &chr(13)
    Response.Write "<TR VALIGN=""top"" ALIGN=""left"">" &chr(13)
    For Each TheField in rsRecords.Fields
       Response.Write "<TD WIDTH=103><P><B>" & TheField.Name & "</B></TD>"
           '&chr(13)
    Next
    Response.Write "</TR>"
    Do Until rsRecords.EOF
       Response.Write "<TR VALIGN=""top"" ALIGN=""left"">" &chr(13)
           For i=0 to rsRecords.Fields.Count -1
               Response.Write "<TD WIDTH=103><P>" & rsRecords.Fields(i) & "</TD>"
           Next
       Response.Write "</TR>"
       rsRecords.MoveNext
    Loop

  101. 25 Feb 2002 at 00:32

    I can't seem to connect to my database. I have tried so many different variations of this code and nothing seems to work. The latest error i got was:


    ADODB.Connection.1 error '80004005'


    SQLState: 01S00
    Native Error Code: 0
    SQLState: 08001
    Native Error Code: 0
    [MERANT][ODBC SQL Server Driver]Insufficient information to connect to the data source
    [MERANT][ODBC SQL Server Driver]Invalid connection string attribute


    I'm using a microsoft access database and I just copied the code from this line for line, rather than trying a customisation like I did with some of the other code samples I've seen and I still couldn't get a connection.


    Does anyone know why this might be. I thought it might be because of the location of my files, but now they're all in the folder with the read/write access on my server and I still can't gain a connection.


    Any help would be appreciated!!

  102. 23 Feb 2002 at 09:29

    1) Looks like it's Unix server, but from what I can gather I'm not sure they support asp(?).


    2) You'll probably have gathered that I'm pretty new at this, how do I go about this?


    cheers

  103. 23 Feb 2002 at 09:29

    1) Looks like it's Unix server, but from what I can gather I'm not sure they support asp(?).


    2) You'll probably have gathered that I'm pretty new at this, how do I go about this?


    cheers

  104. 23 Feb 2002 at 08:55

    for question 1) does the server a mysql database and active server pages? What OS are they running?


    for question 2) To solve the


    Data source name not found or no default driver specified


    error, you need to create the ODBC DSN connection in the System tab rather than the User tab

  105. 23 Feb 2002 at 08:55

    for question 1) does the server a mysql database and active server pages? What OS are they running?


    for question 2) To solve the


    Data source name not found or no default driver specified


    error, you need to create the ODBC DSN connection in the System tab rather than the User tab

  106. 23 Feb 2002 at 07:01

    The only problem is that the server I am using (virtual server) doesn't support ODBC so I don't think there is any other way(?). I did try and use it on another site (different server, with MySQL ODBC) and I got the error:


    Vbscript Runtime error 'ASP 0185 : -2147467259'
    Data source name not found or no default driver specified


    inc-dbconnection.asp,line 14


    I used DRIVER={MySQL}, but I'm a bit confused as to what code I would need to change.


    So 2 questions really 1) What do I do on the server that doesn't support ODBC and 2) What code do I change on the one that does?!


    cheers

  107. 23 Feb 2002 at 07:01

    The only problem is that the server I am using (virtual server) doesn't support ODBC so I don't think there is any other way(?). I did try and use it on another site (different server, with MySQL ODBC) and I got the error:


    Vbscript Runtime error 'ASP 0185 : -2147467259'
    Data source name not found or no default driver specified


    inc-dbconnection.asp,line 14


    I used DRIVER={MySQL}, but I'm a bit confused as to what code I would need to change.


    So 2 questions really 1) What do I do on the server that doesn't support ODBC and 2) What code do I change on the one that does?!


    cheers

  108. 23 Feb 2002 at 05:52

    Yes, it is. All you need to do is download the MySQL ODBC Driver from mysql.com. Then you can create an ODBC/DSN connection in windows, and your ASP script won't know the difference



    (of course, your server still needs to be able to run asp files, however...)

  109. 23 Feb 2002 at 05:52

    Yes, it is. All you need to do is download the MySQL ODBC Driver from mysql.com. Then you can create an ODBC/DSN connection in windows, and your ASP script won't know the difference



    (of course, your server still needs to be able to run asp files, however...)

  110. 22 Feb 2002 at 17:15

    This is the most useful members area tutorial I have found so far and I've searched some, however I'm not sure if I'm going to be able to use it.


    I am using a mysql database, so is it possible to change the code to work with this. If so, what do i change (from/to). If not, does anyone know of a useful php3 tutorial, because I'm blowed if I can find one?


    cheers

  111. 22 Feb 2002 at 17:15

    This is the most useful members area tutorial I have found so far and I've searched some, however I'm not sure if I'm going to be able to use it.


    I am using a mysql database, so is it possible to change the code to work with this. If so, what do i change (from/to). If not, does anyone know of a useful php3 tutorial, because I'm blowed if I can find one?


    cheers

  112. 15 Feb 2002 at 15:38

    Quote:
    [1]Posted by ethai on 15 Feb 2002 02:33 PM[/1]
    Try going to your internet service manager console and restarting your IIS under the action tab with your server highlighted.


    To me, that sounds like you have not commented out the bit to connect to an SQL server; so it's sitting there for a while to decide whether the server actually exists or not, and eventually times out. Please check that you have the SQL server/ other access db code lines commented out.

  113. 15 Feb 2002 at 15:37

    Quote:
    [1]Posted by mingteikg on 21 Dec 2001 05:07 AM[/1]
    I too got this 500 error. I just copy all the code from the db-connection, and the access database name is testdb.


    any suggestion?


    Well, firstly the 500 error is a standard error code saying there is an error in an ASP script; it's not necessarily the same one. Also, you shouldn't copy all the code into db-connection... you need to comment out some of the connection code depending on the type of database you are using.....


  114. 15 Feb 2002 at 14:33

    Try going to your internet service manager console and restarting your IIS under the action tab with your server highlighted.


    Cheers,


    Eugene

  115. 12 Feb 2002 at 11:25

    the db-connection.asp, there were 3 lines... 1 for SQL Server, and 2 for different versions of Access:


    Code:

    '// Use this for SQL Server
    objConn.Open "Driver={SQL Server};Server=sqlservername;" & _
       "UID=username;PASSWORD=password;DATABASE=testdb;"


    '// Use this for an Access 2000 database
    objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("accessdb")


    '// Use this for an Access database (earlier than 2000)
    objConn.Open "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & Server.MapPath("accessdb")

  116. 27 Jan 2002 at 17:01

    Hi, im using an access database, could someone tell me how to connect to it, instead of an SQL db? for, example, what is the equivalent for:


    On Error Resume Next
    sSQL = "INSERT INTO members (username,password) VALUES " & _
      "('" & fixQuotes(Request.Form("username")) & "','" & _
      fixQuotes(Request.Form("password")) & "')"
    cConn.Execute sSQL


    cheers, Greg

  117. 21 Jan 2002 at 07:08

    Firstly,
    I have Personal Web Manager 5.0 and IIS version 5
    I used to run ZoneAlarm but have had to remove for various reasons. I have a Pentium III with a fair chunk of RAM
    I am using W2K Also, I am running the site exclusively for myself ie 1 user.


    Heres what happened to me:
    I had worked out how to serve asp
    Things were cool, running some nice apps etc.
    Suddenly, HTTP1.0 new application failed
    I turned on "nice friendly errors" then
    http 500 internal server error
    NB I could now display only .html
    .asp was incommunicado


    I managed to get the server to display the asp files by going to the Internet Services Manager (off Administrative tools)and right-clicking on the computer name and then restarting IIS.


    PWM seems to run as normal but the IIS part has chucked a wobbly

  118. 07 Jan 2002 at 18:16

    Please can someone send me the files I need for this because I don't understand.

  119. 21 Dec 2001 at 05:09

    I'm using access 2000 db for the database. No SQL here.


    How do I add new field, like full name, email etc?
    Thanks!

  120. 21 Dec 2001 at 05:07

    I too got this 500 error. I just copy all the code from the db-connection, and the access database name is testdb.


    any suggestion?

  121. 17 Dec 2001 at 05:54

    You can set a cookie after the logging in of user. And you can display user name in all the pages. You can use hidden form fields also.

  122. 13 Dec 2001 at 04:25

    First you have to pic up the submit value of USERIG, like
    Request.querystring("Textbox name")=of the Get method or
    Request.Form("Textbox name")=of the Post method  and then you can use it like
    <%
    dim userid
    userid=Request.Form("Textbox name")
    %>


    <h1><% =userid %></h1>

  123. 09 Dec 2001 at 14:40

    I want to display the name a user has used to log in on my default page. I tried using <h1><% =userid %> but it doesnt work. Can anyone tell me how to achieve this.

  124. 03 Dec 2001 at 18:40

    James Crowley said:

    Quote:
    Are cookies enabled? You must have cookies enabled in order to be able to login.


    It doesn't work because they don't support session variables for general membership.


    Ok.


    Finesse

  125. 26 Nov 2001 at 05:07

    Yes, cookies are enabled on every browser that has tried the script. It is just not working. I just tried it another machine and it still does not work.


    Finesse

  126. 25 Nov 2001 at 21:26

    Are cookies enabled? You must have cookies enabled in order to be able to login.

  127. 25 Nov 2001 at 13:34

    On what line does the error occur? (you may need to enable server-side debugging from the IIS console)

  128. 25 Nov 2001 at 09:05

    Okedoke, I made a table in MS Access, uploaded it to my db directory. I am almost positive everything is right in the inc-connection.asp file. When I go to registration page, I get a Error 500 Internal Server error. It also takes a while to "open the page". Can you fill me in here anyone? I am using Brinkster.com

  129. 24 Nov 2001 at 21:56

    After i register, I get taken to the login page.. then it never lets me log in, sayin that invalid user/password!!


    I just ran a query on the db and all the info was there. I am puttin in the right info, but it neveer takes me to the member page!!!!


    Please help!!!


    I really need this member section!!!

  130. 24 Nov 2001 at 21:24

    Here's my sql statment to my Access Database to create my table for members:
    CREATE TABLE members
        (id AUTOINCREMENT PRIMARY KEY,
         [username] char(20),
         [password] char(20))


    This creates the table successfully.


    Step one is fine!


  131. 24 Nov 2001 at 15:54

    I tried this code and it does not work for me. I am using Brinkster.com web hosting, with ASP/ASP.net(ASP 3.0).


    Here are the problems I am experiencing:


    1. Register.asp allows me to register duplicate usernames, with NO error messages.
    2. Even after I register, and login.. i am not taken to the members page. No matter what I do, it says, invalid username/password!!


    Please test it out!
    Here is the address: http://www25.brinkster.com/urbanaffilntwrk/register.asp


    Please help!


    djfinesse_215@yahoo.com

  132. 12 Nov 2001 at 19:02

    Hello. I tried your code for the member's only site, and it works nice, I'm having some trouble though with one aspect of it. The code says if error 222 happens, then the user would be prompted with the error message that the username in already in use, I tested it, registering one username with a password, then registering that same username again. It should've not let me register that name, but it let it go, registering the user, basically, its not checking to see if a user already existst with that name.

  133. 07 Nov 2001 at 15:47

    If you are writing a program/dll in VB/C++ etc you can reference that type library which makes it easy to use Microsoft ADO etc....


    In Active Server Pages, you create an ADO object by using Server.CreateObject("ADODB.Connection") or whatever..

  134. 01 Nov 2001 at 00:31

    Anyone knows what this file is or does (msado21.tlb). It's part of NT4 IIS4. All I know that it has something to do with Global.asa files and SQL databases.
    C:\Program Files\Common Files\System\ADO\msado21.tlb


    Thanks,


    Mo

  135. 31 Oct 2001 at 18:02

    Thanks for pointing that out... as I work almost entirely with SQL Server, I forget about things like that... ;-) I have added the []'s around username and password

  136. 31 Oct 2001 at 17:07

    Hi,


    I had the same problem and found out that it may a problem with reserved words, although I cannot find 'username' or 'password' in the reserved word list for 'MS Access' in my case. The solution is to place [ ] around the field names in the SQL statement.

  137. 31 Oct 2001 at 00:25

    I have been getting the following error:


    The following errors occured:
    - An error occured. -2147217900 : Syntax error in INSERT INTO statement.

  138. 01 Jan 1999 at 00:00

    This thread is for discussions of Creating a Members Area in ASP

Leave a comment

Sign in or Join us (it's free).

AddThis

Related podcasts

  • ASP.NET Caching and Performance

    Steve Smith, owner of ASP Alliance and Lake Quincy Media joins us today to teach us about some hidden gems in ASP.NET caching and performance. Steve’s expertise in this area comes from first-hand experience as Lake Quincy’s ad system serves over 60 requests per second and handles over 150 million...