Re: MS Access / Informix connection is read-only
Posted in 1998
Topics: Triggers, Constraints & Referential Integrity
In article <35238a40.21910312@gate.idg.no>, Nils.Myklebust@nmdata.com says...
>
>>The Unique Indexes would have been a work-around for the problem. When you
>>attach the table(s), Access asks you to specify the Unique Index field and if
>>you select a field, then the table is also updatable.
>
>Yes, but that is definitely not the way to do it. Here is what you do
>in your database (Informix):
>
>create unique index tablename_pi on tablename (fieldnames);
>alter table tablename add constraint primary key (fieldnames)
> constraint tablename_pk;>
>When you create the unique index for the primary key and the primary
>key itself this way you can give it a proper name that Access will
>understand.
>Additionally you gain the benefit of beeing able to manipulate the
>index independently of the primary key for such purposes as recreating
>it if it ever gets corrupted, detatching it or whatever.
>
We're still having trouble. I don't work on the Informix database, others do.
I work on an Access based user interface to the data. I showed them a copy
of your posting and they said that they create the indexes exactly as you
specified. But, when you attach the table to the Access database, Access asks
you to specify the unique key. If you don't specify which field is the unique
key then Access treats the table as read-only. If you do specify a field, the
table is updatable.
As others have said, the interface seems pretty slow, plus we have a lot of
tables to attach and it is error prone.
The index fields for the tables do not start with any special characters.
I have attached the Informix systems tables and looked at them. The table that
specifies the indexes, informix.sysindexes or something like that, has the
names of the primary key(s) and any foreign keys along with the table id
number. The name of the primary key here starts with pk_xxxx
There is a cross reference from this index to the informix.syscolumns table
that contains the name of the field. If I remember correctly, there is room
for up to sixteen indexes for a table. We are generally using one, but not
more than three.
Howard