|
-
Sep 18th, 2009, 05:07 AM
#1
Thread Starter
New Member
VB writes wrong numbers to oracle
Hi
I am using VB to write data into Oracle 9i. At the same time as I write to Oracle I also write to a text. I have noticed that the text file is correct but Oracle sometimes seems to add lots of decimal places and I think that this is due to rounding in VB - eg 1.4 becomes 1.400001 in oracle. This normally does not matter. Recently however I have found that the text file reads 130.6077 and Oracle reads 132.608001708984 - how weird is that!
Any help or advice would be most welcome and thanks in advance.
Here is the VB code:
DECLARE THE LOGDATA PARAMETER-----
Public pLogData As New ADODB.Parameter
SETUP THE PARAMETER-----
pLogData.Direction = adParamInput
pLogData.Type = adSingle
cmWriteLog.Parameters.Append pLogData
WIRTE TO ORACLE, THE SCREEN AND ENG LOG
Sub WriteLog(ByVal EntryCode As String, ByVal RobotEvent As String, Optional ByVal LogData As Single = 0)
'add this log message to the screen - at the top of the list
frmMimic.lstUserLogLog.AddItem CurrentTestRun.novi_test_number & " " & Time & " " & EntryCode & ": " & RobotEvent & ": " & LogData, 0
'add to the Oracle log file
pTestNumber.Value = CurrentTestRun.novi_test_number
pRobotEvent.Value = RobotEvent
pLogData.Value = LogData
pEntryCode.Value = EntryCode
cmWriteLog.Execute 'get oracle to write it
'also add it the engineering log
WriteEngLog RobotEvent, EntryCode, LogData
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|