Skip site navigation (1) Skip section navigation (2)

RE: Cannot update PGSQL databes via ODBC

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'pgsql-interfaces(at)postgresql(dot)org'" <pgsql-interfaces(at)postgresql(dot)org>
Subject: RE: Cannot update PGSQL databes via ODBC
Date: 2000-05-11 08:27:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces

> -----Original Message-----
> From: Steve Holmes [mailto:sholmes(at)primenet(dot)com]
> Sent: 11 May 2000 05:14
> To: pgsql-interfaces(at)postgresql(dot)org
> Subject: [INTERFACES] Cannot update PGSQL databes via ODBC
> When using the latest version of PSQLODBC to connect to a linux
> machine running postgresql 6.5.2, I keep getting read-only mode.  I
> have the privs wide open on the linux side and I even turned off the
> read-only flag in the DSN's advanced driver settings.  When using VB6
> to attempt updating a table, I get the error telling me that update is
> not allowed and that select is the only allowed operations.  BTW, I
> can do a select with it and that part works fine.

In the Datasource options of the ODBC driver, try setting Show Column and
Fake Index under OID Options to 'checked'. This will make VB think that
there is a unique index on every table (the OID is always unique so it's not
far wrong!). 

Another 'gotcha' with ADO is that the inclusion of a semi-colon at the end
of a query (as you would use in psql) will make any resultant recordset
read-only eg. (rs = ADO Recordset object, cn = ADO Connection object)

rs.Open "SELECT * FROM pg_class;", cn

will create a read-only recordset whereas:

rs.Open "SELECT * FROM pg_class", cn

won't. Hope this helps.

NASA uses Windows? Oh great. If Apollo 13 went off course today
the manual would just tell them to open the airlock, flush the astronauts
out, and re-install new ones! - Kibo in the SDM. -


pgsql-interfaces by date

Next:From: Steve HolmesDate: 2000-05-11 11:40:33
Subject: Re: Cannot update PGSQL databes via ODBC
Previous:From: Michael MeskesDate: 2000-05-11 08:14:28
Subject: Re: ECPG failed and Postmaster getting bigger in using perl Pg

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group