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...
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...