Thread: ADO resync and views

ADO resync and views

From
"Tambet Matiisen"
Date:
We are doing a VB6 application with bound controls, ADO and PostgreSQL. Most database access is done through views,
whichis excellent security measure. But there is also a drawback, we cannot use Resync method of ADO recordset to
requeryrecordset contents. Resync needs to know primary key of the table, but views don't have primary key. Optimistic
lockingalso does not behave exactly as we would like.
 

So far I have tested these options:
1. Force ADO to think that one of the fields is primary key - not possible, because KEYCOLUMN dynamic property of
recordsetfield object is read-only.
 
2. ALTER TABLE test ADD PRIMARY KEY (a) - not possible, gives ERROR:  ALTER TABLE: relation "test" is not a table
3. Create PostgreSQL table with primary key and then create SELECT rule on that - works, but is very cumbersome and
uglyand probably incompatible.
 

Anyone with the same problem? An ideas how to do this?

  Tambet