Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Location
    Kampala, Uganda
    Posts
    32

    Unanswered: Records not being committed in DAO

    I'm working on an old package which is using DAO.

    Theres a loop which updates records in the databasde based on values from another database.

    I've got;

    Set dbHQ = DBEngine.OpenDatabase(CurrentDb.Name)
    Set rsHQ = dbHQ.OpenRecordset("<the table to be updated>", dbOpenDynaset)

    rsHQ.edit

    rsHQ.fields(blahblahblah).value = "the new value"

    rsHQ.update


    The problem is;

    when I step through the code it all works OK. The new value is put into the HQ database, but when I close the database and open it again the new values are not there. Its like a commit is not being performed. Is there such a thing in DAO? How do I 'commit' those records? Do I need to set the recordset or db to nothing and/or close the db /recordset?


    where rs is the recordset

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Post

    Try to change the two lines
    Set dbHQ = DBEngine.OpenDatabase(CurrentDb.Name)
    Set rsHQ = dbHQ.OpenRecordset("<the table to be updated>", dbOpenDynaset)


    INTO only


    Set rsHQ = CurrentDB.OpenRecordset("<the table to be updated>", dbOpenDynaset)

  3. #3
    Join Date
    Apr 2004
    Location
    Kampala, Uganda
    Posts
    32
    I tried but it didnt work.

    I forgot to mention. The table being updated is a linked table and its an Oracle table in the background. Thats why I'm asking about commits.

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    I think the DynaSet does not afford updating in ODBC connected tables (not sure)

Posting Permissions

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