If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Got error, need help: invalid character value for cast specification

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-04-10, 03:12
Vielfrass Vielfrass is offline
Registered User
 
Join Date: Aug 2008
Posts: 3
Got error, need help: invalid character value for cast specification

Hello,

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,
Joachim

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 11:20.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On