Search code examples
sqlasp-classicuser-defined-typestype-mismatch

How to do calculations with database values in Classic ASP?


I have to do a calculation to an integer value in classic asp, but i keep getting "type mismatch" error on this line: X = tempID + 1

this is my code:

 Set TheRS = Conn.Execute("select top 1 xx from W_TABLE order by IDX desc")
   tempID = TheRS("xx")
   X = tempID + 1
   TheRS.Close
   Set TheRS = nothing

tempX is of type "User-defined Type"... i'm assuming that's why it wont let me add 1 to it... how can i make this happen?


Solution

  • got it working by changing the select.

    select top 1 xx+1 from W_TABLE order by IDX desc
    

    thanks everyone!