Problem wiht numeric DB Field

Results 1 to 3 of 3

Thread: Problem wiht numeric DB Field

  1. #1
    Join Date
    Dec 1969

    Default Problem wiht numeric DB Field

    Here is my latest problem:<BR><BR>I am trying to add a number to a numeric field from a database using the following code:<BR><BR>nCounter = rsPoll("response1")<BR>nCounter = nCounter + "1"<BR><BR>This gives me an invalid type. When I try:<BR><BR>nCounter = rsPoll("response1")<BR>nCounter = int(nCounter) + "1"<BR><BR>I get:<BR><BR>Microsoft VBScript runtime error &#039;800a01ca&#039; <BR><BR>Variable uses an Automation type not supported in VBScript <BR><BR>What is the problem? What is the proper code to use to get this numberic variable?<BR><BR>Thanks.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default doh!!!

    &nbsp;<BR>Hmm.<BR><BR>nCounter = INT(rsPoll("response1"))<BR>nCounter = (nCounter + 1)<BR><BR><BR>that should do it. you were telling vbs that 1 was a string (well variant of subtype string)<BR>what is the rs("response1") type? format? <BR>is it all numbers, chars what.

  3. #3
    Join Date
    Dec 1969
    Los Angeles, CA

    Default doh! is right

    you must mean CINT..........DORK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts