An unhandled data type was encountered.

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;-

<%@LANGUAGE="VBSCRIPT"%>
<!--#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"
MyProductAndSizeOnly.store

response.Redirect("product_size_update_price.asp?sizeid="&sizeid&"&productid="&request.querystring("productid"))  
%>


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

Many Thanks
LVL 4
claracruzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pvginkelCommented:
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.
0
sybeCommented:
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 http://www.aspfaq.com/show.asp?id=2330
0
sybeCommented:
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.
0
thefritterfatboyCommented:
You converted sizeid further up but didn't do it again for the redirect. Try this:

response.Redirect("product_size_update_price.asp?sizeid="&Cint(sizeid)&"&productid="&request.querystring("productid"))  
0
thefritterfatboyCommented:
Wait... it's coming from the querystring.

response.Redirect("product_size_update_price.asp?sizeid="&size_id&"&productid="&request.querystring("productid"))  

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.