An unhandled data type was encountered.

Posted on 2006-03-23
Last Modified: 2008-03-06
Hello experts am getting the following error;-
Response object error 'ASP 0106 : 80020005'

Type Mismatch

/bdtadmin/product_size_insert_price.asp, line 0

An unhandled data type was encountered.

I cannot for the life of me figure out why the error is occurring. Please see code below;

Code on page is as follows;-

<!--#include file="../Connections/adconnproducts.asp" -->
<!-- #INCLUDE file="../dbComm/cStoreFront.asp" -->
<!-- #INCLUDE file="../dbComm/cPriceByOption.asp" -->
<!-- #INCLUDE file="../dbComm/cProducts.asp" -->
<!-- #INCLUDE file="../dbComm/cSizes.asp" -->
<!-- #INCLUDE file="../dbComm/i_helper.asp" -->

dim MyProductAndSizeOnly
Set MyProductAndSizeOnly = new cPriceByOption

dim product_id
dim size_id
dim storage_type_id
dim base_id
dim storage_option_id

product_id = request.querystring("productid")
size_id = request.querystring("sizeid")
storage_type_id = 0
base_id = 0
storage_option_id = 0

MyProductAndSizeOnly.product_id = cint(product_id)
MyProductAndSizeOnly.size_id = cint(size_id)
MyProductAndSizeOnly.storage_type_id = cint(storage_type_id)
MyProductAndSizeOnly.base_id = cint(base_id)
MyProductAndSizeOnly.storage_option_id = cint(storage_option_id)
MyProductAndSizeOnly.price = 0
MyProductAndSizeOnly.status = "live"


But the funny thing is I get the error on first try, then if I refresh the page, it works fine.#

Many Thanks
Question by:claracruz
    LVL 10

    Expert Comment

    It's very difficult to debug this because I cannot run the code. What you could/should try is removing the cint(...) parts and setting them to 0 for testing. I believe it's probably in one of them.
    LVL 28

    Expert Comment

    Find out which datatype it is. Sometimes a database can return a datatype "decimal" which is unknown to VBScript

    Response.write TypeName(variable)

    See also
    LVL 28

    Expert Comment

    I remember having a similar problem with using SELECT @@IDENTITY on MS SQL Server. That returns a variable of type Decimal. In VBScript you can not process that type, you first need to convert it with CInt, Clng or (for large numbers) with Cdbl.

    That would maybe explain that the error is only on the first try (an insert), on an update, there is no such problem.
    LVL 10

    Expert Comment

    You converted sizeid further up but didn't do it again for the redirect. Try this:

    LVL 10

    Accepted Solution

    Wait... it's coming from the querystring.


    Maybe the problem is your variable name was wrong so it was trying to concatenate a "Nothing" with a string. Try the above.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now