-
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?
-
Hai,
Instead of using rs.edit
you have to use rs.addnew
to update a record.
thanks,
Karun
-
I've tried .AddNew for adding a new record. It still fails at .Update method.