Decimal(19,2) column data missing leading zero when value 1.0 through OLEDB

Advertisement
My column is defined as type decimal(19,2). When I select data through OLEDB(C++), I got .12 if the value is 0.12. The leading 0 is always missing. How do I define a right format of this kind of column? Here is my code fragment.
// Construct the binding array element for each column
for( iCol = 0; iCol < cColumns; iCol++ )
// Bind this column as DBTYPE_WSTR, which tells the provider to
// copy a Unicode string representation of the data into our buffer,
// converting from the native type if necessary
rgBindings[iCol].wType = DBTYPE_STR;
Advertisement

Replay

why do you need to do this? 0.12 and .12 represents same value so if your concern is more in terms of displaying value then you can use format functions in front end to display it.
there's no need of changing base datatype to string just forĀ  this need IMHO
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
It may be convinient for front-end to just display anything from a db query.