Results 1 to 3 of 3

Thread: updating recordsets problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Location
    Australia
    Posts
    115

    Post

    I'm using VB5 SP3 connecting to PostgreSQL via ODBC.

    This is how I open database connection and finally get an updatable recordsets:

    Code:
    Set WS = DBEngine.CreateWorkspace("", "admin", vbNullString, dbUseODBC)
    Set CN = WS.OpenConnection("", dbDriverNoPrompt, False, [connection string])
    Set RS = CN.OpenRecordset("select * from table", dbOpenDynaset, 0, dbPessimistic)
    And the update code:

    Code:
    with RS
        .Edit
        ![Field1] = Text1.Text
        ![Field2] = Text2.Text
        .Update
    end with
    I get the error 3146 - ODBC call failed at .Update statement.

    What could be the problem?

  2. #2
    Member
    Join Date
    Jan 2000
    Location
    Singapore
    Posts
    59

    Post

    Hai,
    Instead of using rs.edit
    you have to use rs.addnew
    to update a record.


    thanks,
    Karun

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 1999
    Location
    Australia
    Posts
    115

    Post

    I've tried .AddNew for adding a new record. It still fails at .Update method.

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