Page 1 of 1

TDBXTypes.INT32 value type cannot be accessed as...

Posted: Tue 05 Aug 2008 16:59
by esasse
I'm getting this error in some queries but I couldn't understand what's causing it.

Project Musical.exe raised exception class TDBXError with message 'TDBXTypes.INT32 value type cannot be accessed as TDBXTypes.INT32 value type'.

Any ideas? Is it related to the driver or an DBX issue?
Using D2007 and Firebird 2.1.1.

Posted: Thu 07 Aug 2008 08:07
by Plash
Please provide a code that reproduces this error.

Posted: Fri 08 Aug 2008 18:25
by wagenheimer
Same problem with me!!!

I have this problem with some String fields when a was using .AsInteger to get his value!

I will try to reproduce this problem again and will post an example here!

Posted: Thu 11 Dec 2008 12:41
by AJR65
I got the same error in my application after upgrading to DBexpress 4
But when the user closes the application and start again it gone. I have a client- server application and a SQL server database

Also some times the error is TDBXTypes.ZSTRINGS value type cannot be accessed value type TDBXTypes.ZSTRINGS.
I tracked that down to
dataset.params.parambyname('ID').value := ID (a integer)
and when I changed it in
dataset.params.parambyname('ID').AsInteger:= ID (a integer) I got no error messages.
The param is defined as an integer.

Posted: Fri 12 Dec 2008 09:41
by Plash
Please try to create a sample that reproduces the problem.

Posted: Tue 04 Aug 2009 14:01
by agvillaca
I'm having the same problem using Delphi2009
The error occurs when I try to do the following in DataSetProvider.BeforeUpdateRecord event:

DeltaDS.FieldByName('fieldname').NewValue := getNewValueFunction;

Note: The GetNewValueFunction returns an Integer;
If I pass an constant value instead of the function, the error do not occur.

I hope this help to find the solution.

Posted: Wed 05 Aug 2009 07:48
by Plash
We could not reproduce the problem. Please send to dbxida*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.

Posted: Wed 05 Aug 2009 12:19
by agvillaca
Hi,

While trying to build the sample app, I found the problem in my code. I fought it was in the field I was trying to update, but it was in the function I used to get the new value. In this function I create a DBXCommand and make a select gen_id from a generator. To get the value and pass as result of function, I was using dbxreader.value[0].GetInt64. I just changed to GetInt32 and the problem was solved.
I just cant' see this issue before 'cause it worked with another driver and started to crash when I changed do Devart.

Sorry 'bout that guys and thanks for the support.