List:General Discussion« Previous MessageNext Message »
From:Ian Date:June 19 2007 1:42pm
Subject:Re: Type Mismatch
View as plain text  
On 19 Jun 2007 at 12:42, Critters wrote:

> Hi,
> I hope someone can help me with my problem, something that has come up 
> when moving code and DB to a new server:
> Connection:
> driver={MySQL ODBC 3.51 
> DRIVER};server=localhost;uid=xxxxxxxxxx;pwd=xxxxxxxxxx;database=xxxxxxxxxx;option=16387
> SQL:
> SELECT (sum_score/sum_votes) AS 'score' FROM xxxxxxxxxx WHERE id = 
> xxxxxxxxxx
> Value of "score":
> 6.2153
> ASP:
> <%=int(RS("score")*25)-20%>
> Error:
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch
> Any help appreciated, I did not have this problem when I had the same 
> set-up but on a server running an earlier version of MySQL and the ODBC 
> driver.


I had a similar problem when using select count(*) on windows.  The MyODBC driver is 
not returning a number type, so the code fails because it is expecting one.

To confirm this add this code:

<%=Typename( RS("score").value) %>

above the line that fails to show what type the MyODBC driver is returning.  When it
for me I was getting 'unknown' instead of 'Long'.

If this is the case you may have to specifically CAST it into a number type in your SQL 
statement or use one of the VBScript functions CInt(), CLng(), CDbl(), CSng() etc.
Hope this helps


Type MismatchCritters19 Jun
  • Re: Type MismatchIan19 Jun
re: Type MismatchJ.R. Bullington19 Jun
  • Re: Type MismatchCritters19 Jun
Re: Type MismatchJ.R. Bullington19 Jun