Error in Databse related code

2»

Comments

  • [b][red]This message was edited by Lego614 at 2004-12-1 13:30:41[/red][/b][hr]
    : : : Ok.Lets start from scratch.Tell me,which datatabase are you using,access or SQL Server?First you were showing connecting to Access,then suddenly it became SQL Server?
    : : :
    : : : Post the code which you are now using,and the exact error message.We will take it from there.
    : : :
    : :
    : : Okay.
    : : I am connecting to a access database wit hthe following collumns:
    : : username - a 15 length string
    : : password - a 15 leingth string
    : : points - an intiger.
    : :
    : : I copied some code for the username/password verification/assigning uname to the username and writing the username cookie. That part works without any errors. The next part is I want a cookie that is a number that is the points, so opperations can be done on it from multiple pages/forms. I would like to go about this any way possible, preferably the first set of code that I posted, as that is the same code (with small variable modifications) that succeded for the username/login
    : :
    :
    :
    : Copy paste the following code to your first version(I hope you know where to paste it..),ans see what happens.
    : [code]
    : <%pointsSQL = "SELECT points FROM tblLoginInfo " _
    : & "WHERE username='" & uname & "'"
    :
    : Set cnnPoints = Server.CreateObject("ADODB.Connection")
    : cnnPoints.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    : & "DBQ=" & Server.MapPath("logindb.mdb"))
    :
    : Set rstPoints = cnnPoints.Execute(pointsSQL)
    : %>
    : [/code]
    :
    YES! No error ,but nothing happens. There is no output or cookie.


    EDIT: Wait, was that the point?

  • : [b][red]This message was edited by Lego614 at 2004-12-1 13:30:41[/red][/b][hr]
    : : : : Ok.Lets start from scratch.Tell me,which datatabase are you using,access or SQL Server?First you were showing connecting to Access,then suddenly it became SQL Server?
    : : : :
    : : : : Post the code which you are now using,and the exact error message.We will take it from there.
    : : : :
    : : :
    : : : Okay.
    : : : I am connecting to a access database wit hthe following collumns:
    : : : username - a 15 length string
    : : : password - a 15 leingth string
    : : : points - an intiger.
    : : :
    : : : I copied some code for the username/password verification/assigning uname to the username and writing the username cookie. That part works without any errors. The next part is I want a cookie that is a number that is the points, so opperations can be done on it from multiple pages/forms. I would like to go about this any way possible, preferably the first set of code that I posted, as that is the same code (with small variable modifications) that succeded for the username/login
    : : :
    : :
    : :
    : : Copy paste the following code to your first version(I hope you know where to paste it..),ans see what happens.
    : : [code]
    : : <%pointsSQL = "SELECT points FROM tblLoginInfo " _
    : : & "WHERE username='" & uname & "'"
    : :
    : : Set cnnPoints = Server.CreateObject("ADODB.Connection")
    : : cnnPoints.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    : : & "DBQ=" & Server.MapPath("logindb.mdb"))
    : :
    : : Set rstPoints = cnnPoints.Execute(pointsSQL)
    : : %>
    : : [/code]
    : :
    : YES! No error ,but nothing happens. There is no output or cookie.
    :
    :
    : EDIT: Wait, was that the point?
    :
    :
    No error means,its getting connected.Thats good news,now can you post your whole code,as you have it now?


  • : : [b][red]This message was edited by Lego614 at 2004-12-1 13:30:41[/red][/b][hr]
    : : : : : Ok.Lets start from scratch.Tell me,which datatabase are you using,access or SQL Server?First you were showing connecting to Access,then suddenly it became SQL Server?
    : : : : :
    : : : : : Post the code which you are now using,and the exact error message.We will take it from there.
    : : : : :
    : : : :
    : : : : Okay.
    : : : : I am connecting to a access database wit hthe following collumns:
    : : : : username - a 15 length string
    : : : : password - a 15 leingth string
    : : : : points - an intiger.
    : : : :
    : : : : I copied some code for the username/password verification/assigning uname to the username and writing the username cookie. That part works without any errors. The next part is I want a cookie that is a number that is the points, so opperations can be done on it from multiple pages/forms. I would like to go about this any way possible, preferably the first set of code that I posted, as that is the same code (with small variable modifications) that succeded for the username/login
    : : : :
    : : :
    : : :
    : : : Copy paste the following code to your first version(I hope you know where to paste it..),ans see what happens.
    : : : [code]
    : : : <%pointsSQL = "SELECT points FROM tblLoginInfo " _
    : : : & "WHERE username='" & uname & "'"
    : : :
    : : : Set cnnPoints = Server.CreateObject("ADODB.Connection")
    : : : cnnPoints.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    : : : & "DBQ=" & Server.MapPath("logindb.mdb"))
    : : :
    : : : Set rstPoints = cnnPoints.Execute(pointsSQL)
    : : : %>
    : : : [/code]
    : : :
    : : YES! No error ,but nothing happens. There is no output or cookie.
    : :
    : :
    : : EDIT: Wait, was that the point?
    : :
    : :
    : No error means,its getting connected.Thats good news,now can you post your whole code,as you have it now?
    :
    :
    :

    Alright, the whole code is:
    [code]
    <%@ Language = "VBScript" %>

    <%
    Option Explicit
    '**********************************************************
    ' To make this script work you simply need to create a
    ' table named tblLoginInfo in your database with one
    ' column named username and another named password. Put
    ' the values you want for username and password into a
    ' record in the table. The advantages of this script are
    ' that it's more secure than if you hard-coded the
    ' username/password values directly in the script, and
    ' that you can change the username and password simply by
    ' changing the values in your login_table.
    '
    ' NOTE: BE SURE TO EITHER MOVE THE INCLUDED SAMPLE
    ' DATABASE TO A SECURE AREA OUTSIDE THE WEB SITE OR
    ' USE A DIFFERENT SECURE DATABASE. OTHERWISE ANYONE
    ' CAN SIMPLY DOWNLOAD THE WHOLE DB AND RETREIVE YOUR
    ' USERNAME AND PASSWORD FROM IT.
    '**********************************************************

    Dim cnnLogin
    Dim rstLogin
    Dim strUsername, strPassword
    Dim strSQL
    Dim uname
    Dim pointsval
    Dim rstPoints
    Dim cnnPoints
    Dim pointsSQL
    DIM objConn

    %>

    Login Page


    <%
    If Request.Form("action") <> "validate_login" Then
    %>

    Login:
    Password:

    <%
    Else
    strSQL = "SELECT * FROM tblLoginInfo " _
    & "WHERE username='" & Replace(Request.Form("login"), "'", "''") & "' " _
    & "AND password='" & Replace(Request.Form("password"), "'", "''") & "';"

    Set cnnLogin = Server.CreateObject("ADODB.Connection")
    cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    & "DBQ=" & Server.MapPath("logindb.mdb"))

    Set rstLogin = cnnLogin.Execute(strSQL)

    If Not rstLogin.EOF Then
    %>


    All the Good Stuff We Want to Hide



    <% Response.Cookies ("ZapZone")("user") = Request.Form("Login")
    Response.Cookies ("user").Expires = DATE + 1
    If Request.Cookies ("ZapZone")("User") <> "" Then
    uname = Request.Cookies ("ZapZone")("user")
    Else
    response.write("You Are Not Logged In!")
    End If
    response.write("Welcome, " & uname)%>




    <%' ln 88 FOR COUNTING +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%>
    <%pointsSQL = "SELECT points FROM tblLoginInfo " _
    & "WHERE username='" & uname & "'"

    Set cnnPoints = Server.CreateObject("ADODB.Connection")
    cnnPoints.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    & "DBQ=" & Server.MapPath("logindb.mdb"))

    Set rstPoints = cnnPoints.Execute(pointsSQL)
    %>



    Logout

    <%
    Else
    %>



    Login Failed - Please verify username and password.


    Try Again

    <%
    'Response.End
    End If

    ' Clean Up
    rstLogin.Close
    Set rstLogin = Nothing
    cnnLogin.Close
    Set cnnLogin = Nothing
    End If
    %>


    [/code]

  • Attempting to work on my own, I changed the code to read:

    [code]
    <%@ Language = "VBScript" %>

    <%
    Option Explicit
    '**********************************************************
    ' To make this script work you simply need to create a
    ' table named tblLoginInfo in your database with one
    ' column named username and another named password. Put
    ' the values you want for username and password into a
    ' record in the table. The advantages of this script are
    ' that it's more secure than if you hard-coded the
    ' username/password values directly in the script, and
    ' that you can change the username and password simply by
    ' changing the values in your login_table.
    '
    ' NOTE: BE SURE TO EITHER MOVE THE INCLUDED SAMPLE
    ' DATABASE TO A SECURE AREA OUTSIDE THE WEB SITE OR
    ' USE A DIFFERENT SECURE DATABASE. OTHERWISE ANYONE
    ' CAN SIMPLY DOWNLOAD THE WHOLE DB AND RETREIVE YOUR
    ' USERNAME AND PASSWORD FROM IT.
    '**********************************************************

    Dim cnnLogin
    Dim rstLogin
    Dim strUsername, strPassword
    Dim strSQL
    Dim uname
    Dim pointsval
    Dim rstPoints
    Dim cnnPoints
    Dim pointsSQL
    DIM objConn

    %>

    Login Page


    <%
    If Request.Form("action") <> "validate_login" Then
    %>

    Login:
    Password:

    <%
    Else
    strSQL = "SELECT * FROM tblLoginInfo " _
    & "WHERE username='" & Replace(Request.Form("login"), "'", "''") & "' " _
    & "AND password='" & Replace(Request.Form("password"), "'", "''") & "';"

    Set cnnLogin = Server.CreateObject("ADODB.Connection")
    cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    & "DBQ=" & Server.MapPath("logindb.mdb"))

    Set rstLogin = cnnLogin.Execute(strSQL)

    If Not rstLogin.EOF Then
    %>


    All the Good Stuff We Want to Hide



    <% Response.Cookies ("ZapZone")("user") = Request.Form("Login")
    Response.Cookies ("user").Expires = DATE + 1
    If Request.Cookies ("ZapZone")("User") <> "" Then
    uname = Request.Cookies ("ZapZone")("user")
    Else
    response.write("You Are Not Logged In!")
    End If
    response.write("Welcome, " & uname)%>




    <%' ln 88 FOR COUNTING +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%>
    <%pointsSQL = "SELECT points FROM tblLoginInfo " _
    & "WHERE username='" & uname & "'"

    Set cnnPoints = Server.CreateObject("ADODB.Connection")
    cnnPoints.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    & "DBQ=" & Server.MapPath("logindb.mdb"))

    Set rstPoints = cnnPoints.Execute(pointsSQL)

    Response.Cookies ("ZapZone")("points") = rstPoints
    Response.Cookies ("points").Expires = DATE + 1
    If Request.Cookies ("ZapZone")("points") <> "" Then
    pointsval = Request.Cookies ("ZapZone")("points")
    Else
    response.write("You Are Not Logged In!")
    End If
    response.write("You have: " & Str(pointsval) & " points!")%>
    %>



    Logout

    <%
    Else
    %>



    Login Failed - Please verify username and password.


    Try Again

    <%
    'Response.End
    End If

    ' Clean Up
    rstLogin.Close
    Set rstLogin = Nothing
    cnnLogin.Close
    Set cnnLogin = Nothing
    End If
    %>


    [/code]

    However, It now outputs the following (with error):

    [quote]
    All the Good Stuff We Want to Hide
    Welcome, Lego614

    Microsoft VBScript runtime error '800a000d'

    Type mismatch: '[object]'

    /lego614/db/login_db.asp, line 98
    [/quote]

  • [b][red]This message was edited by Flakes at 2004-12-5 22:20:13[/red][/b][hr]
    [blue]Which is line 98?Anyway ,change your code to what I have marked in red and see...[/blue]


    : Attempting to work on my own, I changed the code to read:
    :
    : [code]
    : <%@ Language = "VBScript" %>
    :
    : <%
    : Option Explicit
    : '**********************************************************
    : ' To make this script work you simply need to create a
    : ' table named tblLoginInfo in your database with one
    : ' column named username and another named password. Put
    : ' the values you want for username and password into a
    : ' record in the table. The advantages of this script are
    : ' that it's more secure than if you hard-coded the
    : ' username/password values directly in the script, and
    : ' that you can change the username and password simply by
    : ' changing the values in your login_table.
    : '
    : ' NOTE: BE SURE TO EITHER MOVE THE INCLUDED SAMPLE
    : ' DATABASE TO A SECURE AREA OUTSIDE THE WEB SITE OR
    : ' USE A DIFFERENT SECURE DATABASE. OTHERWISE ANYONE
    : ' CAN SIMPLY DOWNLOAD THE WHOLE DB AND RETREIVE YOUR
    : ' USERNAME AND PASSWORD FROM IT.
    : '**********************************************************
    :
    : Dim cnnLogin
    : Dim rstLogin
    : Dim strUsername, strPassword
    : Dim strSQL
    : Dim uname
    : Dim pointsval
    : Dim rstPoints
    : Dim cnnPoints
    : Dim pointsSQL
    : DIM objConn
    :
    : %>
    :
    : Login Page
    :
    :
    : <%
    : If Request.Form("action") <> "validate_login" Then
    : %>
    :
    :
    :
    :
    : : : :
    : : : :
    : : : :
    Login:
    Password:
    :
    : <%
    : Else
    : strSQL = "SELECT * FROM tblLoginInfo " _
    : & "WHERE username='" & Replace(Request.Form("login"), "'", "''") & "' " _
    : & "AND password='" & Replace(Request.Form("password"), "'", "''") & "';"
    :
    : Set cnnLogin = Server.CreateObject("ADODB.Connection")
    : cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    : & "DBQ=" & Server.MapPath("logindb.mdb"))
    :
    : Set rstLogin = cnnLogin.Execute(strSQL)
    :
    : If Not rstLogin.EOF Then
    : %>
    :


    : All the Good Stuff We Want to Hide
    :
    :
    : <% Response.Cookies ("ZapZone")("user") = Request.Form("Login")
    : Response.Cookies ("user").Expires = DATE + 1
    : If Request.Cookies ("ZapZone")("User") <> "" Then
    : uname = Request.Cookies ("ZapZone")("user")
    : Else
    : response.write("You Are Not Logged In!")
    : End If
    : response.write("Welcome, " & uname)%>
    :
    :
    :
    : <%' ln 88 FOR COUNTING +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%>
    : <%pointsSQL = "SELECT points FROM tblLoginInfo " _
    : & "WHERE username='" & uname & "'"
    :
    : Set cnnPoints = Server.CreateObject("ADODB.Connection")
    : cnnPoints.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    : & "DBQ=" & Server.MapPath("logindb.mdb"))
    :
    : Set rstPoints = cnnPoints.Execute(pointsSQL)
    :
    [red] Response.Cookies ("ZapZone")("points") = rstPoints("points")[/red]
    : Response.Cookies ("points").Expires = DATE + 1
    : If Request.Cookies ("ZapZone")("points") <> "" Then
    : pointsval = Request.Cookies ("ZapZone")("points")
    : Else
    : response.write("You Are Not Logged In!")
    : End If
    [red] response.write("You have: " & rstPoints("points") & " points!")[/red]
    : %>
    :
    :
    : Logout
    :
    :

    : <%
    : Else
    : %>
    :


    :
    : Login Failed - Please verify username and password.
    :

    :

    :


    : Try Again
    :

    : <%
    : 'Response.End
    : End If
    :
    : ' Clean Up
    : rstLogin.Close
    : Set rstLogin = Nothing
    : cnnLogin.Close
    : Set cnnLogin = Nothing
    : End If
    : %>
    :
    :
    : [/code]
    :
    : However, It now outputs the following (with error):
    :
    : [quote]
    : All the Good Stuff We Want to Hide
    : Welcome, Lego614
    :
    : Microsoft VBScript runtime error '800a000d'
    :
    : Type mismatch: '[object]'
    :
    : /lego614/db/login_db.asp, line 98
    : [/quote]
    :
    :



  • : [b][red]This message was edited by Flakes at 2004-12-5 22:20:13[/red][/b][hr]
    : [blue]Which is line 98?Anyway ,change your code to what I have marked in red and see...[/blue]
    :
    :
    : : Attempting to work on my own, I changed the code to read:
    : :
    : : [code]
    : : <%@ Language = "VBScript" %>
    : :
    : : <%
    : : Option Explicit
    : : '**********************************************************
    : : ' To make this script work you simply need to create a
    : : ' table named tblLoginInfo in your database with one
    : : ' column named username and another named password. Put
    : : ' the values you want for username and password into a
    : : ' record in the table. The advantages of this script are
    : : ' that it's more secure than if you hard-coded the
    : : ' username/password values directly in the script, and
    : : ' that you can change the username and password simply by
    : : ' changing the values in your login_table.
    : : '
    : : ' NOTE: BE SURE TO EITHER MOVE THE INCLUDED SAMPLE
    : : ' DATABASE TO A SECURE AREA OUTSIDE THE WEB SITE OR
    : : ' USE A DIFFERENT SECURE DATABASE. OTHERWISE ANYONE
    : : ' CAN SIMPLY DOWNLOAD THE WHOLE DB AND RETREIVE YOUR
    : : ' USERNAME AND PASSWORD FROM IT.
    : : '**********************************************************
    : :
    : : Dim cnnLogin
    : : Dim rstLogin
    : : Dim strUsername, strPassword
    : : Dim strSQL
    : : Dim uname
    : : Dim pointsval
    : : Dim rstPoints
    : : Dim cnnPoints
    : : Dim pointsSQL
    : : DIM objConn
    : :
    : : %>
    : :
    : : Login Page
    : :
    : :
    : : <%
    : : If Request.Form("action") <> "validate_login" Then
    : : %>
    : :
    : :
    : :
    : :
    : : : : : : : :
    : : : : : : : :
    : : : : : : : :
    Login:
    Password:
    : :
    : : <%
    : : Else
    : : strSQL = "SELECT * FROM tblLoginInfo " _
    : : & "WHERE username='" & Replace(Request.Form("login"), "'", "''") & "' " _
    : : & "AND password='" & Replace(Request.Form("password"), "'", "''") & "';"
    : :
    : : Set cnnLogin = Server.CreateObject("ADODB.Connection")
    : : cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    : : & "DBQ=" & Server.MapPath("logindb.mdb"))
    : :
    : : Set rstLogin = cnnLogin.Execute(strSQL)
    : :
    : : If Not rstLogin.EOF Then
    : : %>
    : :


    : : All the Good Stuff We Want to Hide
    : :
    : :
    : : <% Response.Cookies ("ZapZone")("user") = Request.Form("Login")
    : : Response.Cookies ("user").Expires = DATE + 1
    : : If Request.Cookies ("ZapZone")("User") <> "" Then
    : : uname = Request.Cookies ("ZapZone")("user")
    : : Else
    : : response.write("You Are Not Logged In!")
    : : End If
    : : response.write("Welcome, " & uname)%>
    : :
    : :
    : :
    : : <%' ln 88 FOR COUNTING +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%>
    : : <%pointsSQL = "SELECT points FROM tblLoginInfo " _
    : : & "WHERE username='" & uname & "'"
    : :
    : : Set cnnPoints = Server.CreateObject("ADODB.Connection")
    : : cnnPoints.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    : : & "DBQ=" & Server.MapPath("logindb.mdb"))
    : :
    : : Set rstPoints = cnnPoints.Execute(pointsSQL)
    : :
    : [red] Response.Cookies ("ZapZone")("points") = rstPoints("points")[/red]
    : : Response.Cookies ("points").Expires = DATE + 1
    : : If Request.Cookies ("ZapZone")("points") <> "" Then
    : : pointsval = Request.Cookies ("ZapZone")("points")
    : : Else
    : : response.write("You Are Not Logged In!")
    : : End If
    : [red] response.write("You have: " & rstPoints("points") & " points!")[/red]
    : : %>
    : :
    : :
    : : Logout
    : :
    : :

    : : <%
    : : Else
    : : %>
    : :


    : :
    : : Login Failed - Please verify username and password.
    : :

    : :

    : :


    : : Try Again
    : :

    : : <%
    : : 'Response.End
    : : End If
    : :
    : : ' Clean Up
    : : rstLogin.Close
    : : Set rstLogin = Nothing
    : : cnnLogin.Close
    : : Set cnnLogin = Nothing
    : : End If
    : : %>
    : :
    : :
    : : [/code]
    : :
    : : However, It now outputs the following (with error):
    : :
    : : [quote]
    : : All the Good Stuff We Want to Hide
    : : Welcome, Lego614
    : :
    : : Microsoft VBScript runtime error '800a000d'
    : :
    : : Type mismatch: '[object]'
    : :
    : : /lego614/db/login_db.asp, line 98
    : : [/quote]
    : :
    : :
    :
    :
    :
    :




    It worked, and I changed the second red line to
    [code]
    response.write("You have: " & pointsval & " points!")
    [/code]
    And it still worked!


  • : It worked, and I changed the second red line to
    : [code]
    : response.write("You have: " & pointsval & " points!")
    : [/code]
    : And it still worked!
    :
    :


    So your cookies are all working.Happy?:-)


  • : : [b][red]This message was edited by Flakes at 2004-12-5 22:20:13[/red][/b][hr]
    : : [blue]Which is line 98?Anyway ,change your code to what I have marked in red and see...[/blue]
    : :
    : :
    : : : Attempting to work on my own, I changed the code to read:
    : : :
    : : : [code]
    : : : <%@ Language = "VBScript" %>
    : : :
    : : : <%
    : : : Option Explicit
    : : : '**********************************************************
    : : : ' To make this script work you simply need to create a
    : : : ' table named tblLoginInfo in your database with one
    : : : ' column named username and another named password. Put
    : : : ' the values you want for username and password into a
    : : : ' record in the table. The advantages of this script are
    : : : ' that it's more secure than if you hard-coded the
    : : : ' username/password values directly in the script, and
    : : : ' that you can change the username and password simply by
    : : : ' changing the values in your login_table.
    : : : '
    : : : ' NOTE: BE SURE TO EITHER MOVE THE INCLUDED SAMPLE
    : : : ' DATABASE TO A SECURE AREA OUTSIDE THE WEB SITE OR
    : : : ' USE A DIFFERENT SECURE DATABASE. OTHERWISE ANYONE
    : : : ' CAN SIMPLY DOWNLOAD THE WHOLE DB AND RETREIVE YOUR
    : : : ' USERNAME AND PASSWORD FROM IT.
    : : : '**********************************************************
    : : :
    : : : Dim cnnLogin
    : : : Dim rstLogin
    : : : Dim strUsername, strPassword
    : : : Dim strSQL
    : : : Dim uname
    : : : Dim pointsval
    : : : Dim rstPoints
    : : : Dim cnnPoints
    : : : Dim pointsSQL
    : : : DIM objConn
    : : :
    : : : %>
    : : :
    : : : Login Page
    : : :
    : : :
    : : : <%
    : : : If Request.Form("action") <> "validate_login" Then
    : : : %>
    : : :
    : : :
    : : :
    : : :
    : : : : : : : : : : : :
    : : : : : : : : : : : :
    : : : : : : : : : : : :
    Login:
    Password:
    : : :
    : : : <%
    : : : Else
    : : : strSQL = "SELECT * FROM tblLoginInfo " _
    : : : & "WHERE username='" & Replace(Request.Form("login"), "'", "''") & "' " _
    : : : & "AND password='" & Replace(Request.Form("password"), "'", "''") & "';"
    : : :
    : : : Set cnnLogin = Server.CreateObject("ADODB.Connection")
    : : : cnnLogin.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    : : : & "DBQ=" & Server.MapPath("logindb.mdb"))
    : : :
    : : : Set rstLogin = cnnLogin.Execute(strSQL)
    : : :
    : : : If Not rstLogin.EOF Then
    : : : %>
    : : :


    : : : All the Good Stuff We Want to Hide
    : : :
    : : :
    : : : <% Response.Cookies ("ZapZone")("user") = Request.Form("Login")
    : : : Response.Cookies ("user").Expires = DATE + 1
    : : : If Request.Cookies ("ZapZone")("User") <> "" Then
    : : : uname = Request.Cookies ("ZapZone")("user")
    : : : Else
    : : : response.write("You Are Not Logged In!")
    : : : End If
    : : : response.write("Welcome, " & uname)%>
    : : :
    : : :
    : : :
    : : : <%' ln 88 FOR COUNTING +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%>
    : : : <%pointsSQL = "SELECT points FROM tblLoginInfo " _
    : : : & "WHERE username='" & uname & "'"
    : : :
    : : : Set cnnPoints = Server.CreateObject("ADODB.Connection")
    : : : cnnPoints.Open("DRIVER={Microsoft Access Driver (*.mdb)};" _
    : : : & "DBQ=" & Server.MapPath("logindb.mdb"))
    : : :
    : : : Set rstPoints = cnnPoints.Execute(pointsSQL)
    : : :
    : : [red] Response.Cookies ("ZapZone")("points") = rstPoints("points")[/red]
    : : : Response.Cookies ("points").Expires = DATE + 1
    : : : If Request.Cookies ("ZapZone")("points") <> "" Then
    : : : pointsval = Request.Cookies ("ZapZone")("points")
    : : : Else
    : : : response.write("You Are Not Logged In!")
    : : : End If
    : : [red] response.write("You have: " & rstPoints("points") & " points!")[/red]
    : : : %>
    : : :
    : : :
    : : : Logout
    : : :
    : : :

    : : : <%
    : : : Else
    : : : %>
    : : :


    : : :
    : : : Login Failed - Please verify username and password.
    : : :

    : : :

    : : :


    : : : Try Again
    : : :

    : : : <%
    : : : 'Response.End
    : : : End If
    : : :
    : : : ' Clean Up
    : : : rstLogin.Close
    : : : Set rstLogin = Nothing
    : : : cnnLogin.Close
    : : : Set cnnLogin = Nothing
    : : : End If
    : : : %>
    : : :
    : : :
    : : : [/code]
    : : :
    : : : However, It now outputs the following (with error):
    : : :
    : : : [quote]
    : : : All the Good Stuff We Want to Hide
    : : : Welcome, Lego614
    : : :
    : : : Microsoft VBScript runtime error '800a000d'
    : : :
    : : : Type mismatch: '[object]'
    : : :
    : : : /lego614/db/login_db.asp, line 98
    : : : [/quote]
    : : :
    : : :
    : :
    : :
    : :
    : :
    :
    :
    :
    :
    : It worked, and I changed the second red line to
    : [code]
    : response.write("You have: " & pointsval & " points!")
    : [/code]
    : And it still worked!
    :
    :



    Yeah...
    Now that that's over, my Host wont let me use CDONTS, so I need to now use another (free) host!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories