Click to See Complete Forum and Search --> : Runtime error 3027: Can't Update:Database or object is read only


gaddu
February 26th, 2003, 06:31 PM
I connected visual basic 5 and oracle. I am trying to addnew records in the database. I used the code as follows:
Private Sub cmdAdd_Click()
Set wst = CreateWorkspace("ODBCworkspace", "xxx", "xxx", dbUseODBC)
Set db = wst.OpenDatabase("oracle", dbDriverNoPrompt, False, "ODBC;DATABASE=oracle;UID=xxx;PWD=xxx;DSN=oracle;")
Set rs = db.OpenRecordset("address_table", dbOpenDynaset)
rs.MoveLast
rs.AddNew
rs!first_name = txtfirst_name.Text
rs.Update

rs.Close
db.Close
wst.Close

End Sub

When I omitted the workspace object and used only database and recordset object the code works fine...
Pls help...

antares686
February 27th, 2003, 06:39 AM
Try this

Set rs = db.OpenRecordset("address_table", dbOpenDynaset, dbExecDirect, dbOptimisticValue)

If that doesn't help , what Oracle client version are you using?

And finally you should consider moving to ADO as DAO may be loosing a lot of future support.

gaddu
February 27th, 2003, 10:05 AM
Hi,
I tried the code u sent:
Set rs = db.OpenRecordset("address_table", dbOpenDynaset, dbExecDirect, dbOptimisticValue)
then on the line rs.update error occurs saying
Run time Error 3146: ODBC call failed.
THe value of text goes to rs!first_name, but it cannot be updated...
Have any idea?
I am using Oracle 8.1.5.