Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Type Mismatch again

    Hi,

    One page passes a strIssueNo to another, so on the 2nd page:

    Dim IssueNo
    IssueNo = Request.Item("strIssueNo")

    This 2nd page is designed to create a new record in a database table,
    however I get a Type Mismatch error. This is the line that adds the issue
    number:

    rsAddNote.Fields("IssueNo") = IssueNo

    The field IssueNo is a numerical field in the table, and strIssueNo that is
    being passed from the previous page is definitely a number.

    What is wrong with my syntax and how can I correct this error?

    Thanks in advance.



    Miguel Orrego Guest

  2. Similar Questions and Discussions

    1. Type mismatch error
      This query works fine on a live server using an MSSQL database: <cfquery name="qIndex" datasource="#appDSN#" username="shampoo"...
    2. Interface Type Mismatch
      This works in Java, so it is not clear why Actionscript does not implement it the same way. If an instance of a class that implements an Interface...
    3. Type mismatch?
      Hi i'm getting a type mismatch error, anyone tell me why pls? conn.Execute "DELETE FROM Bmemo WHERE (tDate <= '" & date() & "')" tDate is a...
    4. Type Mismatch
      I'm at my wits end here. I am getting type mismatch error in a ASP page when I try to multiply decimals*integers. This shouldn't be this difficult....
    5. Type mismatch in expression
      Dear anyone, I used the wizard to make a form, but when I try to go from design view to form view an eooro message comes up "Type mismatch in...
  3. #2

    Default Re: Type Mismatch again

    If you're sure that the data is going to be valid then you can just force
    the type with CInt()
    If you're not so sure, then try applying IsNumeric() first.
    e.g:
    dim IssueNo
    IssueNo= Request.Item("strIssueNo")
    If IsNumeric(IssueNo) then
    rsAddNote.Fields("IssueNo") = CInt(IssueNo)
    End If

    Hope it helps.

    Matt


    Matt Smith Guest

  4. #3

    Default Re: Type Mismatch again

    isn't the limit for int around 32000? Seems you'd be hard-pressed to fit
    906k into that datatype.

    Possible your db field is something else ?

    tim



    "Miguel Orrego" <miguel@stressedmonkey.net-nospam> wrote in message
    news:3f05a610$0$10627$cc9e4d1f@news.dial.pipex.com ...
    > Thanks Matt, unfortunately this still doesn't seem to solve the problem.
    >
    > I am certain that strIssueNumber is a number, because this is the link
    that
    > the previous page generates to get to this one:
    >
    >
    [url]http://webserver/systems/helpdesk/globm/createnote.asp?strIssueNo=0000000000[/url]
    > 0000906741
    >
    > When I try to use
    >
    > rsAddNote.Fields("IssueNo") = CInt(IssueNo)
    >
    > I now get a different error:
    >
    > Microsoft VBScript runtime error '800a0006'
    >
    > Overflow: 'CInt'
    >
    > /systems/helpdesk/globm/createnote.asp, line 39
    >
    >
    >
    > The field IssueNo in the database table is an integer field. The database
    is
    > sql server 7.0
    >
    > Any ideas?
    >
    > Thanks.
    >
    >
    >
    > "Matt Smith" <_matt@breathemail.net> wrote in message
    > news:be43nq$re4$1@hercules.btinternet.com...
    > > If you're sure that the data is going to be valid then you can just
    force
    > > the type with CInt()
    > > If you're not so sure, then try applying IsNumeric() first.
    > > e.g:
    > > dim IssueNo
    > > IssueNo= Request.Item("strIssueNo")
    > > If IsNumeric(IssueNo) then
    > > rsAddNote.Fields("IssueNo") = CInt(IssueNo)
    > > End If
    > >
    > > Hope it helps.
    > >
    > > Matt
    > >
    > >
    >
    >

    Tim Williams Guest

  5. #4

    Default Re: Type Mismatch again

    To avoid the overflow, use CLng(strIssueNo)


    "Tim Williams" <saxifrax@pacbell*dot*net> wrote in message
    news:%23dnyInmQDHA.1564@TK2MSFTNGP12.phx.gbl...
    > isn't the limit for int around 32000? Seems you'd be hard-pressed to fit
    > 906k into that datatype.
    >
    > Possible your db field is something else ?
    >
    > tim
    >
    >
    >
    > "Miguel Orrego" <miguel@stressedmonkey.net-nospam> wrote in message
    > news:3f05a610$0$10627$cc9e4d1f@news.dial.pipex.com ...
    > > Thanks Matt, unfortunately this still doesn't seem to solve the problem.
    > >
    > > I am certain that strIssueNumber is a number, because this is the link
    > that
    > > the previous page generates to get to this one:
    > >
    > >
    >
    [url]http://webserver/systems/helpdesk/globm/createnote.asp?strIssueNo=0000000000[/url]
    > > 0000906741
    > >
    > > When I try to use
    > >
    > > rsAddNote.Fields("IssueNo") = CInt(IssueNo)
    > >
    > > I now get a different error:
    > >
    > > Microsoft VBScript runtime error '800a0006'
    > >
    > > Overflow: 'CInt'
    > >
    > > /systems/helpdesk/globm/createnote.asp, line 39
    > >
    > >
    > >
    > > The field IssueNo in the database table is an integer field. The
    database
    > is
    > > sql server 7.0
    > >
    > > Any ideas?
    > >
    > > Thanks.
    > >
    > >
    > >
    > > "Matt Smith" <_matt@breathemail.net> wrote in message
    > > news:be43nq$re4$1@hercules.btinternet.com...
    > > > If you're sure that the data is going to be valid then you can just
    > force
    > > > the type with CInt()
    > > > If you're not so sure, then try applying IsNumeric() first.
    > > > e.g:
    > > > dim IssueNo
    > > > IssueNo= Request.Item("strIssueNo")
    > > > If IsNumeric(IssueNo) then
    > > > rsAddNote.Fields("IssueNo") = CInt(IssueNo)
    > > > End If
    > > >
    > > > Hope it helps.
    > > >
    > > > Matt
    > > >
    > > >
    > >
    > >
    >
    >

    Marvin Thompson Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139