Is an updateable/insertable recordset via ADO possible using MS-Access?

Started by Karen Hillalmost 20 years ago2 messagesgeneral
Jump to latest
#1Karen Hill
karen_hill22@yahoo.com

Hello.

I have an MS - Access front end which connects to PostgreSQL 8.1.3.
Almost everything is working great, I especially love how I can use
rules in PostgreSQL to be able to update and insert into views, which
is awesome.

Now my only issue, and I'm not sure this is even possible but here it
is. Can one base an MS Access form on a PostgreSQL table using only
ADO and have it be updateable and insertable? Currently all I'm able
to do is get the data as READONLY when I do it via ADO, yet when I use
linked tables in MS Access I am able to update and insert. Here is the
ADO code:

Sub Form_Open ( Cancel As Integer)

Dim cn As ADODB.Connection
Dim rs AS ADODB.RecordSet

Set cn = New ADODB.Connection
Set rs = New ADODB.RecordSet

cn.Open "DSN=PostgreSQL ANSI; Database=db; UID=postgres;
Password=xxxx;"

rs.CursorLocation = adUseServer
rs.Open "SELECT * FROM view_x;", cn, adOpenKeySet, adLockOptimistic
Set Me.Recordset = rs

End Sub

The above returns records to the form, its just that they are not
updateable or insertable. Thanks for your help.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Karen Hill (#1)
Re: Is an updateable/insertable recordset via ADO possible using MS-Access?

"Karen Hill" <karen_hill22@yahoo.com> writes:

Can one base an MS Access form on a PostgreSQL table using only
ADO and have it be updateable and insertable?

Damifino, but the people who would know probably hang out in pgsql-odbc,
not here ...

regards, tom lane