Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Posts
    1

    Unanswered: "Invalid Character value for cast specification" from VC++ when i execute a proc

    Hi Everybody,

    I have a question regarding the running of a procedure from VC++ in SQL server.

    well this is the scenario.

    i have a procedure in SQL server and i am running that thru my VC++ code.

    i have a recordset class and i create an object of it and then do a obj.Open(). the procedure is fetching 24 records correctly in the query analyser and in my while(!(obj.IsEOF())) loop it gets the first record correctly but the moment it encounters obj.MoveNext(); it bombs and gives me the following error..

    "Invalid Character value for cast specification ".

    i don't know why this is happening

    Thanks for you help.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Somewhere in your Transact-SQL code you are trying to convert a character value to another datatype. My first guess would be DATETIME, next might be INT or another numeric datatype. This is usually either in a column you are returning or in a WHERE clause, but it can happen anywhere you can refer to a column.

    -PatP

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    BTW, since this actually appears to be a Transact-SQL problem, I'm moving the thread back to the Microsoft SQL forum.

    -PatP

Posting Permissions

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