TDBXTypes.ZSTRINGS value type

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AJR65
Posts: 3
Joined: Tue 09 Dec 2008 11:00

TDBXTypes.ZSTRINGS value type

Post by AJR65 » Tue 09 Dec 2008 11:10

I inherited an client-server program and have upgrate it to delphi 2007 andDBexpress 4. I connect to SQLserver
In one situation I get the following error TDBXTypes.ZSTRINGS value type cannot be accessed as TDBXTypes.ZSTRINGS value type
When I try to open a clientdataset after I changed the parameter I get this error.
other datasets in my program are not giving me any trouble.
Any ideas on the possible cause for this problem?
Or any hint which direction I should take a look?

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

Post by AJR65 » Wed 10 Dec 2008 10:44

I figured out that the problem was the setting of the params
I had
dataset.params.parambyname('ID').value := ID (defined as integer)
when I changed it to
dataset.params.parambyname('ID').AsInteger := ID (defined as integer)
I didn't get the error any more.
Don't know were the error came from, but is send me to seach in the wrong direction

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 11 Dec 2008 12:26

The problem is that when you use the Value property to set the parameter value TParam tries to define a value type itself, but when you use the AsInteger property, you specify the type explicitly. Therefore, it is preferred to use AsInteger.

Post Reply