Page 1 of 1

TDBXTypes.ZSTRINGS value type

Posted: Tue 09 Dec 2008 11:10
by AJR65
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?

Posted: Wed 10 Dec 2008 10:44
by AJR65
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

Posted: Thu 11 Dec 2008 12:26
by Dimon
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.