Tyoe Mismatch error

Results 1 to 4 of 4

Thread: Tyoe Mismatch error

  1. #1
    Join Date
    Dec 1969

    Default Tyoe Mismatch error

    I&#039m getting a "type mismatch" error on the line below. The rsOptions recordset was successfully created and opened, so my reference is correct, but I&#039m stuck!<BR><BR>intVotes = rsOptions("Votes") + 1 <BR><BR>Any thoughts?

  2. #2
    Join Date
    Dec 1969

    Default RE: Tyoe Mismatch error

    Try this...<BR><BR>intVotes = CInt (rsOptions("Votes")) + 1 or<BR>intVotes = CLng (rsOptions("Votes")) + 1<BR><BR>depending on whether the number of votes can exceed 32767 <BR><BR><BR><BR>

  3. #3
    schnookums Guest

    Default RE: Tyoe Mismatch error

    Hi Jennifer,<BR><BR>Good question. This is probably a case where rsOptions("Votes") is either NULL or contains a string value. <BR><BR>You can try to force conversion to numeric type with CLNG or VAL, but a better approach might be:<BR><BR> if isnumeric(rsOptions("Votes")) then intVotes = rsOptions("Votes") + 1<BR><BR><BR>Hope this helps!

  4. #4
    Manoj V Guest

    Default RE: Tyoe Mismatch error

    Why don&#039t you Explicitly Change the datatype to integer before adding like <BR><BR> <BR>invotes=cint(rsoptions("Votes")) + cint(1)<BR><BR> try this <BR><BR>Manoj V <BR>

Posting Permissions

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