Subject | Re: Sending demo of Problem |
---|---|
Author | Helen Borrie |
Post date | 2001-09-27T05:42:35Z |
At 01:46 PM 27-09-01 +1000, you wrote:
Here are the problems I found and fixed:
1. Your persistent fields were not instantiated. I did that and, in each case, I did the following:
(a) set the precision appropriate to the definitions in the DDL - viz. below:
CREATE TABLE "TRANSACTION_INFO"
(
"ID" CHAR(12),
"AMOUNT" NUMERIC(11, 2), /* set precision to 2 */
"AMOUNT_2" NUMERIC(3, 2), /* set precision to 2 */
"AMOUNT_3" NUMERIC(14, 4), /* set precision to 4 */
"AMOUNT_4" NUMERIC(5, 4) /* set precision to 4 */
);
(b) set Currency property to True on the first two amount fields and the last
(c) set DisplayFormat property on the third amount field
viz. first time around, I set it to $#0.#### (APP_snapshot1.gif)
second time, I set it to $#0.0000 (APP_snapshot1.gif)
2. I set your Keylinks to ID. (Notice that I had a little trouble with this because you made this a char(12) so your unique id values get stored as "FIRST ", "SECOND " and "THIRD " and a query 'where "ID" = 'FIRST' will not find the row...if you want to use character fields as key fields, make them VARCHAR.)
3. Your button handler had this:
IBOTable1.Fields[0].Value := 4598.58
Naturally, all this did was to change the ID field of the selected record !!
Both of these statements worked fine:
IBOTable1.Fields[1].Value := 4598.58;
IBOTable1.Fields[3].Value := 4598.5813;
I've attached a file (which won't make it to the list) containing the snapshots of the IB_SQL display and the demo app with everything fixed. The monitor output is included too.
A further tip - don't use quoted identifiers in your DDL !!!!!!!!!!!!!!!!!!!!!
Regards,
Helen
----------
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
[Non-text portions of this message have been removed]
>HelenPeter,
>
>I have attached the sample on to this email.
>
>The sample that I am sending is small and basic. When I run it here and type a value into the grid it changes it to .2. You can see that the .2 is sent to the dbms in the log.
>
>Note that you can change the value in the string field to any thing and it is fine
Here are the problems I found and fixed:
1. Your persistent fields were not instantiated. I did that and, in each case, I did the following:
(a) set the precision appropriate to the definitions in the DDL - viz. below:
CREATE TABLE "TRANSACTION_INFO"
(
"ID" CHAR(12),
"AMOUNT" NUMERIC(11, 2), /* set precision to 2 */
"AMOUNT_2" NUMERIC(3, 2), /* set precision to 2 */
"AMOUNT_3" NUMERIC(14, 4), /* set precision to 4 */
"AMOUNT_4" NUMERIC(5, 4) /* set precision to 4 */
);
(b) set Currency property to True on the first two amount fields and the last
(c) set DisplayFormat property on the third amount field
viz. first time around, I set it to $#0.#### (APP_snapshot1.gif)
second time, I set it to $#0.0000 (APP_snapshot1.gif)
2. I set your Keylinks to ID. (Notice that I had a little trouble with this because you made this a char(12) so your unique id values get stored as "FIRST ", "SECOND " and "THIRD " and a query 'where "ID" = 'FIRST' will not find the row...if you want to use character fields as key fields, make them VARCHAR.)
3. Your button handler had this:
IBOTable1.Fields[0].Value := 4598.58
Naturally, all this did was to change the ID field of the selected record !!
Both of these statements worked fine:
IBOTable1.Fields[1].Value := 4598.58;
IBOTable1.Fields[3].Value := 4598.5813;
I've attached a file (which won't make it to the list) containing the snapshots of the IB_SQL display and the demo app with everything fixed. The monitor output is included too.
A further tip - don't use quoted identifiers in your DDL !!!!!!!!!!!!!!!!!!!!!
Regards,
Helen
----------
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
[Non-text portions of this message have been removed]