Results 1 to 1 of 1
  1. #1
    Join Date
    Aug 2008

    Unanswered: Got error, need help: invalid character value for cast specification


    we develop an application that uses MS ADO 2.8 for SQL Server access. For one costumer, there's a certain amount of PC's that fail on a query at startup, making the application useless.

    They receive the error "(0x80040e21): Ungültiger Zeichenwert für Umwandlungsangabe." (illegal character value for cast specification) or (invalid character value for cast specification). There is nothing wrong with the query to be executed, it works fine for everybody except for those special systems.

    This is the query that fails:

    SELECT guidResourceID, nLicenseType FROM viewResource WHERE
    nResourceFunction IN ( 0, 4 ) AND
    NOT( guidBaseObjID = '{DA3922C5-3366-43AA-B267-94882359559D}' ) AND
    ( fIsHistory = 0 ) AND
    ( fIsDeleted = 0 ) AND
    ( nLicenseType <> 2 ) AND
    ( UPPER(RTRIM(strSystemAccount)) = 'XYZ\Z123456' )
    AND guidResourceID NOT IN ( SELECT DISTINCT guidParentID FROM tblConnection INNER JOIN viewResource VRES ON tblConnection.guidChildID = VRES.guidResourceID WHERE VRES.fIsDeleted = 0)

    The constants used in the WHERE clause are passed as Parameters to an ADO Command Object, i replaced them with actual values here.

    The error occurs on PCs using Windows XP Pro SP2 or SP3. I got the MDAC Dlls from one affected system, which seem to be perfectly ok. The error does not occur on all systems, and i do not have direct access to the PCs.

    Maybe somebody has an idea?

    Thank You,

    EDIT: Tests have narrowed the focus to the following issue: The Error occurs only on certain Parameter combinations. If i pass the constant for ( UPPER(RTRIM(strSystemAccount)) = 'XYZ\Z123456' ) AND any of the other constants (but at least one!), the query fails. If I use Parameters only for the strSystemAccount clause OR only any of the other clauses, the query passes. This does not really help me, but maybe anybody has heard about a phenomenon like this before?
    Last edited by Vielfrass; 05-04-10 at 12:20.

Posting Permissions

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