cant add records to oracle

runni
10-11-2000, 03:37 PM
I am using DAO to add records to oracle but I keep getting
ERROR 3146 -ODBC call fail even though I am able to delete
and modify records
error occurs at rs.Update so basically each time I use
Addnew and try to update i get the error

Dim db As Database
Dim rs As Recordset

Private Sub Command1_Click() 'Add record button
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
rs.AddNew
End Sub
'code for Save Details button
If rs.EditMode = dbEditAdd Or rs.EditMode =dbEditInProgressThen
rs("sem") = CInt(Text1.Text)
rs("sub") = Text2.Text
rs("m") = CInt(Text3.Text)

rs.Update 'Error occurs here
End If

Set db = OpenDatabase("abc", , , "ODBC;UID=snrty;PWD=*****;dsn=abc")
Set rs = db.OpenRecordset("select * from marksha", dbOpenDynaset, dbRunAsync, dbOptimisticValue)

i am using personal oracle 8. do i have to change some settings there????

please help

niktesla
10-11-2000, 11:35 PM
Paste your code that is failing and the table schema if possible and we will se what we can do.

Brian

Brian T. Wiehoff

runni
10-12-2000, 03:16 PM
thanks for replying

I have posted part of the code
so I hope you can help me out now

niktesla
10-12-2000, 04:55 PM
Try this in your save button.

If you already have the database open and the recordset populated, and it is in scope in the event, you can take it out of this code. I would try this code first though.

Dim db As Database
Dim rs As Recordset

Set db = OpenDatabase("abc", , , "ODBC;UID=snrty;PWD=*****;dsn=abc")
Set rs = db.OpenRecordset("select * from marksha", dbOpenDynaset)

' Ensure that data is in the fields.
' Use this at your discression to require data input
If isnumeric(Text1) and text2 & "" <> "" and isnumeric(text3) Then

With rs
.AddNew
!sem = cint(text1)
!sub = text2
!m = cint(text3)
.Update
.Bookmark = .LastModified
End With

Else
Debug.Print _
"You must enter the required information!"
End If

rs.Close
db .Close


Brian T. Wiehoff

runni
10-14-2000, 03:51 PM
I tried that and a hundred other things
but I still get the same error
ODBC call fail!!!!!!!!!!

I am convinced that the table is read-only (even though I am able to modify and delete records) so all you people out there who know anything about personal oracle 8
Please let me know how I can change the read only setting of a table or if you feel there is someothing else I can do
PLEASE let me know

niktesla
10-15-2000, 10:33 AM
I also believe that personal oracle may only provide one connection at a time. If you open a recordset as dynamic somewhere, that would cause it.



Brian T. Wiehoff

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum