Click to See Complete Forum and Search --> : Updating values in Oracle


August 14th, 1999, 04:30 AM
Hi there!

Have a problem with updating records in oracle :
i am using RDO to access oracle data. My sample code as follows

Dim env As rdoEnvironment
Dim con As rdoConnection
Dim rs As rdoResultset

Private Sub Form_Load()

Set env = rdoEngine.rdoEnvironments(0)
env.CursorDriver = rdUseOdbc
Set con = env.OpenConnection("", rdDriverNoPrompt, False, "uid=scott;pwd=tiger;dsn=oracledata")
SSQL = "select * from dept"
Set rs = con.OpenResultset(SSQL, rdOpenDynamic, rdConcurRowVer)
SSQL = "select empno,ename,sal,comm,deptno from emp"
Set rs1 = con.OpenResultset(SSQL, rdOpenDynamic, rdConcurRowVer)
Text1.Text = rs!deptno
Text2.Text = rs!dname
Text3.Text = rs!Loc
End Sub

Private Sub CommandEdit_Click()
rs.Edit
End Sub
Private Sub CommandAddnew_Click()
rs.addnew
End Sub

Private Sub CommandSave_Click()
rs!deptno = Text1.Text
rs!dname = Text2.Text
rs!Loc = Text3.Text
rs.Update
End Sub

problem is when i say rs.edit and update record it's giving error:
Run time error 40002
IM006:[MICROSOFT][ODBC Drivers Manager] Drivers sqlsetconnectAttr failed

but when i add new record it's inserting records without any problem
I am using VB5 and ORACLE8 Client
And the same code is working good in Personal Oracle7.3

Thanks in advance!

S joy
August 14th, 1999, 08:11 AM
Hi
The Error Code is basically for the error in Connection object.
Try with DSN-less Connection as:

rdoenvironment(0).OpenConnection("",rddrivernoprompt,false,"server=oracledata;Driver={Microsoft ODBC for Oracle};uid=scott;pwd=tiger"



I don't know the default cursor type in RDO ,is it Readonly ?
I hope it will help you