Print Page | Close Window

Type Mismatch?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5310
Printed Date: 30 March 2026 at 9:50pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Type Mismatch?
Posted By: Mikeap
Subject: Type Mismatch?
Date Posted: 26 August 2003 at 4:36pm

I get a TYPE MISMATCH on the following line?

strRound1 = (Cstr(arrRound1)) ???



-------------
I am dedicated to being addicted.



Replies:
Posted By: michael
Date Posted: 26 August 2003 at 8:37pm
is arrRound1 an array???

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: 2gawd
Date Posted: 27 August 2003 at 5:42pm

I've come across the exact same error, still trying to figure it out.  I get it on the following line though:

Machine Name: <input type="text" name="machine_name" maxlength="20" value="<% = rsInventory("Machine_Name") %>"> 



-------------
Rob

VB/ASP Metamorphing Neophyte


Posted By: vshriniwasan
Date Posted: 28 August 2003 at 11:39am

Well you have two different problems her. Mikeap is converting a var to a string and 2gawd is writing a field from a database.

Mikeap - Without knowing what is arrRound1, it is hard to find out.

2gawd - As far as you, what is the SELECT statement you are using. It could be the select statement that is doing this. If you are trying to say field = ???, try field LIKE ???. If you are using Access, you cannot use equal for Autonumber and Numerical filed types.



Posted By: 2gawd
Date Posted: 28 August 2003 at 12:11pm

The actual error is as follows:

  • Error Type:
    Microsoft VBScript runtime (0x800A000D)
    Type mismatch: 'rsInventory'
    /update_form.asp, line 37

    I'm using Access but the Machine_Name field I'm trying to update is a text field.  rsInventory is my recordset object which I defined by this line:

  • Set rsInventory = Server.CreateObject("ADODB.Recordset")

  •  

     



    -------------
    Rob

    VB/ASP Metamorphing Neophyte


    Posted By: MorningZ
    Date Posted: 28 August 2003 at 12:24pm

    chances are that recordset may be empyt, or has been closed by then, or something......

    the error aint lying



    -------------
    Contribute to the working anarchy we fondly call the Internet


    Posted By: 2gawd
    Date Posted: 28 August 2003 at 12:30pm

    I built it off of the "Updating Data in an Access Database" tutorial.  The only difference is the names of my fields and the fact that there are more to update.  If you all are interested I'll post the entire code.



    -------------
    Rob

    VB/ASP Metamorphing Neophyte


    Posted By: MorningZ
    Date Posted: 28 August 2003 at 12:35pm

    cant speak for anyone but myself.. but do so and i'll try to help

    also real quick though.. are there other fields around that statement that do work???

    have you tried to:
    Response.Write rsInventory("Machine_Name")
    Response.End
    right after the Recordset gets filled to absolutely positively make sure it has valid info



    -------------
    Contribute to the working anarchy we fondly call the Internet


    Posted By: 2gawd
    Date Posted: 28 August 2003 at 1:12pm

    The first page that loads does a Response.Write rsInventory("Machine_Name") and so on for the other fields and works properly.  The "Machine_Name" is also defined as a link.  When selected it takes the "ID" (an Autonumber field) and posts it to the update form which is were I'm having the problem.  Here is the code:

    ***************************************************

    'Dimension variables
    Dim adoCon    'Holds the Database Connection Object
    Dim rsInventory   'Holds the recordset for the record to be updated
    Dim strSQL   'Holds the SQL query for the database
    Dim lngRecordNo   'Holds the record number to be updated

    'Read in the record number to be updated
    lngRecordNo = CLng(Request.QueryString("ID"))

    'Create an ADO connection odject
    Set adoCon = Server.CreateObject("ADODB.Connection")

    'Set an active connection to the Connection object using a DSN-less connection
    adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("inventory.mdb")

    'Set an active connection to the Connection object using DSN connection
    'adoCon.Open "DSN=inventory"

    'Create an ADO recordset object
    Set rsInventory = Server.CreateObject("ADODB.Recordset")

    'Initialise the strSQL variable with an SQL statement to query the database
    strSQL = "SELECT Desktop_Server.* FROM Desktop_Server WHERE ID LIKE" & lngRecordNo

    'Open the recordset with the SQL query
    rsInventory.Open strSQL, adoCon
    %>

    <html>
    <head>
    <title>Inventory Update Form</title>
    </head>
    <body bgcolor="white" text="black">

    <!-- Begin form code -->
    <form name="form" method="post" action="update_entry.asp">
      Machine Name: <input type="text" name="machine_name" maxlength="255" value="<% = rsInventory("Machine_Name") %>"><br>
      DFC Tag: <input type="number" name="DFC_ID" maxlength="20" value="<% = rsInventory("DFC_ID") %>"><br>
      Asset Name: <input type="text" name="Asset Name" maxlength="20" value="<% = rsInventory("Asset Name") %>"><br>
      Serial Number: <input type="text" name="Serial Number" maxlength="20" value="<% = rsInventory("Serial Number") %>"><br>
      CPU: <input type="text" name="CPU" maxlength="20" value="<% = rsInventory("CPU") %>"><br>
      Memory (Mb): <input type="number" name="Memory (Mb)" maxlength="20" value="<% = rsInventory("Memory (Mb)") %>"><br>
      HDD (Gb): <input type="number" name="HDD (Gb)" maxlength="20" value="<% = rsInventory("HDD (Gb)") %>"><br>
      Platform / PWTELLER: <input type="text" name="Platform / PWTELLER" maxlength="20" value="<% = rsInventory("Platform / PWTELLER") %>"><br>
      Inquiry: <input type="text" name="Inquiry" maxlength="20" value="<% = rsInventory("Inquiry") %>"><br>
      Premier II ITI: <input type="text" name="Premier II ITI" maxlength="20" value="<% = rsInventory("Premier II ITI") %>"><br>
      Premier Central / PWCRT: <input type="text" name="Premier Central  / PWCRT" maxlength="20" value="<% = rsInventory("Premier Central  / PWCRT") %>"><br>
      Accessory Printer: <input type="text" name="Accessory Printer" maxlength="20" value="<% = rsInventory("Accessory Printer") %>"><br>
      Monitor SN: <input type="text" name="Mon_SSN" maxlength="20" value="<% = rsInventory("Mon_SSN") %>"><br>
      Monitor DFC: <input type="text" name="Mon_DFC" maxlength="20" value="<% = rsInventory("Mon_DFC") %>"><br>
      <input type="hidden" name="ID" value="<% = rsInventory("ID") %>">
      <input type="submit" name="Submit" value="Submit">
    </form>
    <!-- End form code -->

    </body>
    </html>

    <%
    'Reset server objects
    rsInventory.Close
    Set rsInventory = Nothing
    Set adoCon = Nothing
    %>

    ***************************************************



    -------------
    Rob

    VB/ASP Metamorphing Neophyte


    Posted By: Mikeap
    Date Posted: 30 August 2003 at 9:18pm

    I am still getting my TYPE MISMATCH on the following:

    For iCounter = 0 to 16
    R1Team(iCounter) = arrRound1(3,iCounter)
    If IsNull(R1Team(iCounter)) or IsEmpty(R1Team(iCounter)) Then
    R1Team(iCounter) = "None"
    End If
    Next

    arrRound1 being my arry which is equal to a GetRow statement (recordset)

    On the second line of the above is where I'm getting the TYPE MISMATCH.

    R1Team(iCounter) = arrRound1(3,iCounter)

    What I'm trying to do is collect information into a variable.  So R1Team(0) would be = arrRound1(3,0) which would keep all information "aligned" and I would be pulling the right stuff.



    -------------
    I am dedicated to being addicted.



    Print Page | Close Window

    Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
    Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net