CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2001
    Location
    England
    Posts
    3

    VB and Oracle problem

    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.



  2. #2
    Join Date
    Aug 2001
    Posts
    26

    Re: VB and Oracle problem

    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



  3. #3
    Join Date
    Sep 2001
    Location
    Elmshorn, Germany
    Posts
    8

    Re: VB and Oracle problem

    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

  4. #4
    Join Date
    Sep 2001
    Location
    England
    Posts
    3

    Re: VB and Oracle problem

    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.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured