Writing to Oracle DB

garyd1234

Board Regular
Joined
Apr 17, 2003
Messages
103
Hi,
I am writing a program that updates both an Access table and an Oracle table every time a new record is entered or something changes. Having trouble writing to Oracle table from Access. Anyone know how? I am trying :
Dim wrkJet As Workspace
Dim wrkODBC As Workspace
Dim db As DAO.Database
Set db = CurrentDb()
Dim con As DAO.Connection
Dim od As Workspace

Dim rs As DAO.Recordset

Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set wrkODBC = CreateWorkspace("", "admin", "", dbUseODBC)
Set con = wrkODBC.OpenConnection("", , False, _
"ODBC;DATABASE=;UID=LAW;PWD=GARY;DSN=LawDB")
' bring current data from the Oracle tables into the Access tables for searching or new record creation
'Set od = OpenDatabase(con)
'Set rs = con.OpenRecordset("SELECT * FROM COMPLAINTS", dbOpenDynaset)


On my insert, I don't know what to put for the object. I tried

con.execute " insert etc"
This gives ODBC- call failed" as an error

I also tried the addnew, update method but it gives "Can't update. Database is Read Only". But it isn't.

Thanks for any help
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,221,581
Messages
6,160,630
Members
451,661
Latest member
hamdan17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top