Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type mismatch - IIS or SQL problem?

Status
Not open for further replies.

denoxis

Programmer
Jul 22, 2002
154
US
Hi,

I don't know if you have ever had this problem, little strange. I have a database driven website (Windows 2000 + MSSQL2000). I have another database driven website (Windows 2000 + MSSQL 2000). I have the exactly same table on two different databases (Table X). Datatypes of the 3 fields are smallmoney, smallmoney and decimal(4,2).

On one web site following code works:
...
data = rs.getrows
if data(0,0) <> 0 and data(1,0) <> 0 THEN
' blah blah
end if

On another it gives me type mismatch error unless I make the changes:
...
data = rs.getrows
if cdbl(data(0,0)) <> 0 and data cdbl(data(1,0)) <> 0 THEN
' blah blah
end if

I cannot get a sum either unless I convert all of them to double one by one. Any clues why does it act like that?
 
IIRC, something simular happened to me. I believe it was with null values.

HTH
 
I response.write all the values, they all show &quot;0&quot; so it's not null issue. It's not string either, but it acts like one. I wonder if the currency datatype is converted to a string at one of the application layer on some configurations.
 
I have 3 columns in that data array. First two columns returned Currency for the TypeName() But the last one gave me this:

Variable uses an Automation type not supported in VBScript: 'typename'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top