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

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for InterBase & Firebird in Delphi and C++Builder
Post Reply
esasse
Posts: 47
Joined: Tue 27 Nov 2007 19:08
Location: Brazil

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

Post by esasse » Tue 05 Aug 2008 16:59

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 07 Aug 2008 08:07

Please provide a code that reproduces this error.

wagenheimer
Posts: 13
Joined: Thu 27 Sep 2007 21:02

Post by wagenheimer » Fri 08 Aug 2008 18:25

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!

AJR65
Posts: 3
Joined: Tue 09 Dec 2008 11:00

Post by AJR65 » Thu 11 Dec 2008 12:41

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 12 Dec 2008 09:41

Please try to create a sample that reproduces the problem.

agvillaca
Posts: 3
Joined: Tue 04 Aug 2009 13:54

Post by agvillaca » Tue 04 Aug 2009 14:01

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 05 Aug 2009 07:48

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.

agvillaca
Posts: 3
Joined: Tue 04 Aug 2009 13:54

Post by agvillaca » Wed 05 Aug 2009 12:19

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.

Post Reply