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

  1. #1

    Default Operand type clash

    Hello all. We have a page that calls a SQL Server database using this
    method,

    cn.uspGetEventPerson Null, Null, rsEventPersons

    where cn is our connection object, and uspGetEventPerson is the stored
    procedure. When we call the database with nulls, we get the following error:

    Microsoft OLE DB Provider for SQL Server
    Operand type clash: text is incompatible with int

    Both of the fields are integer fields, and the stored procedure. When we use
    an ADO Command object and define the parameters, it works fine, even if
    those two parameters are null. Why does the shortcut method break and the
    command object work? Thanks in advance.


    dw Guest

  2. Similar Questions and Discussions

    1. Clash of GUIDs SelectPageRange.ocx and DSOFramer.ocx
      I have used DSOFramer for some time to embed Microsoft office apps into my applications. It comes from Microsoft but is not fully supported by them....
    2. wrong operand type - error
      I've seen a decent number of people who have said that they have received the same error that I have now received. I received some artwork in Quark...
    3. Help with an illegal 'operand'?
      Does anyone know why I'm getting this error message - Can't open illustration. The illustration contains illegal operand. Offending operator :...
    4. illegal operand problem.
      Oh dear, it was all going so well and then this came up when I tried to re-open my AI file. When I click OK I get a page with the correct size but...
    5. operand variable question
      I am creating a flash calculator and used the actionscript from the sample included in the program. What i would like to know is where does this...
  3. #2

    Default Re: Operand type clash

    dw wrote:
    > Hello all. We have a page that calls a SQL Server database using this
    > method,
    >
    > cn.uspGetEventPerson Null, Null, rsEventPersons
    >
    > where cn is our connection object, and uspGetEventPerson is the stored
    > procedure. When we call the database with nulls, we get the following
    > error:
    >
    > Microsoft OLE DB Provider for SQL Server
    > Operand type clash: text is incompatible with int
    >
    > Both of the fields are integer fields, and the stored procedure.
    It would help if you showed the portion of your CREATE PROCEDURE statement
    in which the parameters are declared. Without that, we have to resort to
    guesswork.
    > When
    > we use an ADO Command object and define the parameters, it works
    > fine, even if those two parameters are null. Why does the shortcut
    > method break and the command object work? Thanks in advance.
    Without the explicit Command object, ADO is making a guess as to datatype,
    and guessing wrong. Are these optional parameters? If so, you should be able
    to call the procedure without specifying these arguments:

    cn.uspGetEventPerson rsEventPersons

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  4. #3

    Default Re: Operand type clash

    Thanks, Bob. Here's the procedure's CREATE portion,

    CREATE PROCEDURE dbo.uspGetEventPerson
    @prmEventID int = null,
    @prmTerm varchar (6) = null
    AS .....

    The second parameter is a varchar, not an int as indicated earlier. These
    two parameters are optional. Thanks for your help.


    "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:eXI9%2392MEHA.3944@tk2msftngp13.phx.gbl...
    > dw wrote:
    > > Hello all. We have a page that calls a SQL Server database using this
    > > method,
    > >
    > > cn.uspGetEventPerson Null, Null, rsEventPersons
    > >
    > > where cn is our connection object, and uspGetEventPerson is the stored
    > > procedure. When we call the database with nulls, we get the following
    > > error:
    > >
    > > Microsoft OLE DB Provider for SQL Server
    > > Operand type clash: text is incompatible with int
    > >
    > > Both of the fields are integer fields, and the stored procedure.
    >
    > It would help if you showed the portion of your CREATE PROCEDURE statement
    > in which the parameters are declared. Without that, we have to resort to
    > guesswork.
    >
    > > When
    > > we use an ADO Command object and define the parameters, it works
    > > fine, even if those two parameters are null. Why does the shortcut
    > > method break and the command object work? Thanks in advance.
    >
    > Without the explicit Command object, ADO is making a guess as to datatype,
    > and guessing wrong. Are these optional parameters? If so, you should be
    able
    > to call the procedure without specifying these arguments:
    >
    > cn.uspGetEventPerson rsEventPersons
    >
    > Bob Barrows
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >

    dw Guest

  5. #4

    Default Re: Operand type clash

    dw wrote:
    > Thanks, Bob. Here's the procedure's CREATE portion,
    >
    > CREATE PROCEDURE dbo.uspGetEventPerson
    > @prmEventID int = null,
    > @prmTerm varchar (6) = null
    > AS .....
    >
    > The second parameter is a varchar, not an int as indicated earlier.
    That explains the error message.
    > These two parameters are optional. Thanks for your help.
    >
    So does my suggestion work?

    cn.uspGetEventPerson rsEventPersons
    >
    > "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
    > news:eXI9%2392MEHA.3944@tk2msftngp13.phx.gbl...
    >> dw wrote:
    >>> Hello all. We have a page that calls a SQL Server database using
    >>> this method,
    >>>
    >>> cn.uspGetEventPerson Null, Null, rsEventPersons
    >>>
    >>> where cn is our connection object, and uspGetEventPerson is the
    >>> stored procedure. When we call the database with nulls, we get the
    >>> following error:
    >>>
    >>> Microsoft OLE DB Provider for SQL Server
    >>> Operand type clash: text is incompatible with int
    >>>
    >>> Both of the fields are integer fields, and the stored procedure.
    >>
    >> It would help if you showed the portion of your CREATE PROCEDURE
    >> statement in which the parameters are declared. Without that, we
    >> have to resort to guesswork.
    >>
    >>> When
    >>> we use an ADO Command object and define the parameters, it works
    >>> fine, even if those two parameters are null. Why does the shortcut
    >>> method break and the command object work? Thanks in advance.
    >>
    >> Without the explicit Command object, ADO is making a guess as to
    >> datatype, and guessing wrong. Are these optional parameters? If so,
    >> you should be able to call the procedure without specifying these
    >> arguments:
    >>
    >> cn.uspGetEventPerson rsEventPersons
    >>

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  6. #5

    Default Re: Operand type clash

    Yes, it does. Works like a charm! Thanks, Bob.

    "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:Os%23fwP3MEHA.3348@TK2MSFTNGP09.phx.gbl...
    > dw wrote:
    > > Thanks, Bob. Here's the procedure's CREATE portion,
    > >
    > > CREATE PROCEDURE dbo.uspGetEventPerson
    > > @prmEventID int = null,
    > > @prmTerm varchar (6) = null
    > > AS .....
    > >
    > > The second parameter is a varchar, not an int as indicated earlier.
    >
    > That explains the error message.
    >
    > > These two parameters are optional. Thanks for your help.
    > >
    > So does my suggestion work?
    >
    > cn.uspGetEventPerson rsEventPersons
    >
    > >
    > > "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
    > > news:eXI9%2392MEHA.3944@tk2msftngp13.phx.gbl...
    > >> dw wrote:
    > >>> Hello all. We have a page that calls a SQL Server database using
    > >>> this method,
    > >>>
    > >>> cn.uspGetEventPerson Null, Null, rsEventPersons
    > >>>
    > >>> where cn is our connection object, and uspGetEventPerson is the
    > >>> stored procedure. When we call the database with nulls, we get the
    > >>> following error:
    > >>>
    > >>> Microsoft OLE DB Provider for SQL Server
    > >>> Operand type clash: text is incompatible with int
    > >>>
    > >>> Both of the fields are integer fields, and the stored procedure.
    > >>
    > >> It would help if you showed the portion of your CREATE PROCEDURE
    > >> statement in which the parameters are declared. Without that, we
    > >> have to resort to guesswork.
    > >>
    > >>> When
    > >>> we use an ADO Command object and define the parameters, it works
    > >>> fine, even if those two parameters are null. Why does the shortcut
    > >>> method break and the command object work? Thanks in advance.
    > >>
    > >> Without the explicit Command object, ADO is making a guess as to
    > >> datatype, and guessing wrong. Are these optional parameters? If so,
    > >> you should be able to call the procedure without specifying these
    > >> arguments:
    > >>
    > >> cn.uspGetEventPerson rsEventPersons
    > >>
    >
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >

    dw 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