Update DBGrid with formatted number

huer
huer used Ask the Experts™
on
I have a VB6.0 application with Oracle(oo4o 8i).
I use DBGrid and Oracle Data Control.

My table is

 EMPNO              NUMBER
 ENAME              VARCHAR2(20)
 SALARY             NUMBER(11,2)

My client want the number in DBGrid shown in certain format. For example, number with two decimal points like(11.00).

if I change the ORADC recordsource from
oradcEmp.RecordSource = "select empno, ename, salary from emp "

oradcEmp.RecordSource = "select empno, ename, to_char(salary,'99.00') from emp "

The my recordset become not updatable set. I cannot update DBGrid.

Can someone tell me how to solve this?

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012
Commented:
Change the format in DBGrid.  Look for the NumberFormat attribute in the Columns tab.

Anthony

Author

Commented:
Thanks. Anthony.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial