www.webdeveloper.com
Results 1 to 4 of 4

Thread: Type Mismatch????????

  1. #1
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168

    Angry Type Mismatch????????

    How the heck am I getting type mismatch they are just text.
    It won't accept the administrator name and pass, so won't redirect to admin page. If I take that segment of code out, as long as the user name and pass is in the database the page here will show.

    Error Type:
    Microsoft VBScript runtime (0x800A000D)
    Type mismatch
    /hunting/wwwroot/LoggedMainPics.asp, line 87


    <% @Language = VBScript %>
    <% Option Explicit %>

    <%
    Dim Hunt_Id, Hunt_Password, dbConn, dbQuery, recordsetDB, strquerystring1

    Hunt_Id = request.form("OldHunt_Id")
    Hunt_Password = request.form("Hunt_Password")

    If IsObject(Session("users_dbConn") ) Then
    Set dbConn= Session("users_dbConn")
    Else
    Set dbConn = Server.CreateObject("ADODB.Connection")

    Call dbConn.Open ("Appdb1","Anyone","Anyone")

    Set Session("users_dbConn")= dbConn
    End If
    %>
    <html>

    <head>
    <title>New Page 2</title>
    <base target="_self">
    <meta name="Microsoft Theme" content="cactus 111">
    </head>

    <body background="cactxtr.gif" bgcolor="#FFFF99" text="#003300" link="#990000" vlink="#006633" alink="#663300">

    <p>&nbsp;&nbsp; <img border="0" src="northshoreadventures1logo.gif" width="364" height="160"></p>

    <p>&nbsp;</p>

    <form NAME="Login" METHOD="POST" ACTION="UpdateReg.asp">

    &nbsp;Welcome <%=Hunt_Id%> <input type="hidden" name="OldHunt_Id" size="24" Value="<%=Hunt_Id%>">To
    Change your Registration click here<input type="submit" value="GO" name="B1">


    </form>
    <form NAME="AddStorie" METHOD="POST" ACTION="AddStories.asp">
    <input type="hidden" name="OldHunt_Id" size="24" Value="<%=Hunt_Id%>">
    <input type="hidden" name="Hunt_Password" size="24" Value="<%=Hunt_Password%>">

    <p><%=Hunt_Id%> Add your stories click here<input type="submit" value="GO" name="B1"></p>
    </form>
    <form NAME="VIEW_Storie" METHOD="POST" ACTION="View_Storie.asp">
    <input type="hidden" name="OldHunt_Id" size="24" Value="<%=Hunt_Id%>">
    <input type="hidden" name="Hunt_Password" size="24" Value="<%=Hunt_Password%>">

    VIEW STORIES OTHER MEMBERS HAVE MADE <input type="submit" value="GO" name="view">
    </form>


    <p>&nbsp; <img border="0" src="deergun.gif" width="159" height="64">
    </p>
    <p><a href="Season.html">THE HUNTING SEASONS WHAT YOU CAN GET AND WHEN</a></p>

    <form NAME="Comments" METHOD="POST" ACTION="Comments.asp">
    <input type="hidden" name="OldHunt_Id" size="24" Value="<%=Hunt_Id%>">
    <input type="hidden" name="Hunt_Password" size="24" Value="<%=Hunt_Password%>">

    <p><%=Hunt_Id%> Add your comments click here<input type="submit" value="GO" name="B1"></p>
    </form>

    <form NAME="VIEW_comm" METHOD="POST" ACTION="View_Comments.asp">
    <input type="hidden" name="OldHunt_Id" size="24" Value="<%=Hunt_Id%>">
    <input type="hidden" name="Hunt_Password" size="24" Value="<%=Hunt_Password%>">

    VIEW COMMENTS OTHER MEMBERS HAVE MADE <input type="submit" value="GO" name="view"></p>
    </form>

    </body>
    </html>

    <%
    strquerystring1 = "SELECT Hunt_Registration.Hunt_Id, Hunt_Registration.Hunt_Password " & _
    "FROM Hunt_Registration " & _
    "WHERE Hunt_Registration.Hunt_Id = " &" '" & Hunt_Id & "' and Hunt_Registration.Hunt_Password = " &" '" & Hunt_Password & "' "
    set recordsetDB = dbconn.execute(strquerystring1)
    %>
    <%
    if recordsetDB.eof then
    response.redirect("Nouser.html")
    end if

    if recordsetDB = " & Hunt_Id & " = "Administrator" and " & Hunt_Password & " = "Brad" then

    response.redirect ("Admin.Asp")

    end if

    recordsetDB.Close
    %>

  2. #2
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    8

    DB Error

    You are getting the type mismatch error because of this line of code:

    if recordsetDB = " & Hunt_Id & " = "Administrator" and " & Hunt_Password & " = "Brad" then

    It should read...

    if recordsetDB("MYFIELDNAME") = " & Hunt_Id & " = "Administrator" and " & Hunt_Password & " = "Brad" then

  3. #3
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    8

    what da?

    hmmmm. but there is a lot of syntax errors in that very line of code... ????

    What exactly are you trying to say on that line? Are you trying to check if the username and password match?

    If so, you don't need to do this as you know they do because the record set opens only if there is a match. This line:

    if recordsetDB = " & Hunt_Id & " = "Administrator" and " & Hunt_Password & " = "Brad" then

    ...doesn't make much sense to me... Is this what it should read?

    If recordsetDB("Hunt_ID") = "Administrator" AND recordsetDB("Hunt_Password") = "Brad" then
    Last edited by missLord; 02-18-2003 at 01:08 AM.

  4. #4
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168
    Ya it worked, stupid me. Thx alot.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles