Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    4

    Unanswered: oraOledb question

    I am adding a record to a database using the followin code:

    Set tablaADO = New ADODB.Recordset
    tablaADO.Open "Archivos", oracleConnection, adOpenKeyset, adLockOptimistic

    Set mStream = New ADODB.Stream
    mStream.Charset = "us-ascii"
    mStream.Type = adTypeText
    mStream.Open
    mStream.LoadFromFile "c:\file.txt"

    arreglo = Array("Archivo", "id")
    valores = Array(mStream.ReadText, id)
    tablaADO.AddNew arreglo, valores
    tablaADO.Update
    mStream.Close
    Set mStream = Nothing
    tablaADO.Close
    Set tablaADO = Nothing

    This code inserts the record to the database, however , often the program stalls until I do a commit on the oracle sql *plus, after the commit the program ends.

    Why is that happening??

    I'm using oracle 8.1.7.0.0 and oraoledb
    ADO 2.7
    VB 6.0 sp 5

    the table in the oracle database is called "Archivos" it has a field "Archivo" type CLOB, and a field "id" type number.

  2. #2
    Join Date
    Jan 2003
    Posts
    4

    Re: oraOledb question

    /*
    This code inserts the record to the database, however , often the program stalls until I do a commit on the oracle sql *plus, after the commit the program ends.
    */

    Here is what I found out:

    first I insert a new record in the database, it works fine.

    Then, if I try to insert that same record again I get the integrity constraint error for a primary key (intended behavior)

    Then I go to the SQL *plus client and I delete the record.

    Then If I try to insert the record again, the program stalls until I do a commit in the SQL *plus.

    Well, it seems that I needed to do a commit after deleting the record, otherwise the program would stall waiting for the database to have a commited state.

    simple thing and took me a while to figure out.

Posting Permissions

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