cb
unread,Sep 26, 2011, 10:40:37 PM9/26/11You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
I'm using ADO connection via ODBC to connect to Sybase DB.
When i'm doing a query via stored procedure, i'll get a decimal value
like '1500.00'
But in my program i can only get the value '15', meaning the two '0'
at the back is somehow truncated.
I've tried a simple sql in the stored procedure like
SELECT 1500.00
just for testing purpose.
And i get the same result of '15' (from
mobjSaiisTaksirRst.Fields.Item(0))
My sample code as below
Private mobjSaiisTaksirRst As ADODB.Recordset
Private mobjSaiisTaksirConn As ADODB.Connection
Private mobjSaiisTaksirCmd As ADODB.Command
Dim dblJumlahSewa As Double
With mobjSaiisTaksirCmd
.ActiveConnection = mobjSaiisTaksirConn
.CommandText = mstrSewaInfoProc
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("no_akaun", adVarChar,
adParamInput, 20, strAccount)
End With
Set mobjSaiisTaksirRst = mobjSaiisTaksirCmd.Execute
If Not mobjSaiisTaksirRst.EOF Then
dblJumlahSewa = IIf(IsNull(mobjSaiisTaksirRst.Fields.Item(0)),
0, mobjSaiisTaksirRst.Fields.Item(0))
End If
Do you have any idea what is wrong ?
Thanks.
regards,
Tan