Click to See Complete Forum and Search --> : VB and Oracle problem
apawaskar
September 3rd, 2001, 04:08 AM
I am connecting to Oracle table using Microsoft ODBC Driver. I am able to add new records, update , delete it. But I am not able to add new record or update it when the field is number with precision(like number(10,2)). I am using ADODB and recordset objects, addNew method and Update method of the recordset object.
Can anyone find me a solution for this ? It will be a great help to me.
bhanuprakash
September 3rd, 2001, 06:34 AM
i would suggest u to use the oracle update command instead of addnew since oracle update can also update precision numbers.
or did u check what type of datatype is ur temporary variable which is storing the data check that but still if you coudnt then its better u user oracle update commnad
KIK
September 3rd, 2001, 08:49 AM
Have you checked the language-settings of Windows.
I think theres a problem with "," and "." if you write numbers like 12,3.
Example: Server: English-settings, client german settings
KIK
apawaskar
September 3rd, 2001, 09:49 AM
Thanks for the reply. I am using the following code. It works fine when using Insert command.
Private Sub Command1_Click()
Dim cn As new ADODB.Connection
Dim rs As new ADODB.Recordset
Dim strConnection As String
Dim strSQL As String
cn.CursorLocation = adUseClient
strConnection = "DSN=TEST;UID=scott;PWD=tiger"
cn.Open strConnection
strSQL = "select * from table1"
rs.Open strSQL, cn, adOpenKeyset,adLockOptimistic
rs.AddNew
rs!C1 = 101.5
rs.Update
Set rs = Nothing
End Sub
I m using Microsoft ODBC driver for Oracle
I get the following error
"[Microsoft][ODBC driver for Oracle][Oracle]ORA-01722: invalid number"
Please help me if u find any solution.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.