Board index » delphi » MSSQL:Table does not support this operation because it is not uniquely indexed

MSSQL:Table does not support this operation because it is not uniquely indexed

I use Delphi 3 and SQL Server 6.5 under Windows NT Workstation
4.0. For editing table MyTable i use TQuery with trivial SQL query:
"SELECT * FROM MyTable", but if i call a Refresh method (or change
values of lookup field) i have a BDE error: "Table does not support this

operation because it is not uniquely indexed". All setting of SQL Server

are default. One property of TQuery is not default: RequestLive = true.
Please help me!

  vcard.vcf
< 1K Download
 

Re:MSSQL:Table does not support this operation because it is not uniquely indexed


The Refresh method does not work with SQL databases. You need to close and
re-open the query to refresh the result.
--

Bill Seifert
Software Vision, Inc.

Alexey E. Matveev <lmatv...@granit.ru> wrote in article
<34B7F73D.CC55A...@granit.ru>...

Quote
> I use Delphi 3 and SQL Server 6.5 under Windows NT Workstation
> 4.0. For editing table MyTable i use TQuery with trivial SQL query:
> "SELECT * FROM MyTable", but if i call a Refresh method (or change
> values of lookup field) i have a BDE error: "Table does not support this

> operation because it is not uniquely indexed". All setting of SQL Server

> are default. One property of TQuery is not default: RequestLive = true.
> Please help me!

Re:MSSQL:Table does not support this operation because it is not uniquely indexed


Alexey,

We're using Sybase SQL Anywhere and found the following three solutions
to enable refresh to work properly.

1) When you create your Primary Key Column include the "Unique" keyword.

2) Add a Unique table constraint.

3) Add an index to the primary key that is specified Unique.

Delphi seemed unable to determine that a Primary Key in SQLA was a
unique column (SQLA uses an internal unique index on PK and FK columns
that Delphi can't see).  I don't know if this is true of SQL Server.
Another work around is to handle the refresh method in an exception
block... If it fails then bookmark, close, open, and try to goto
bookmark.

HTH - Mike

Re:MSSQL:Table does not support this operation because it is not uniquely indexed


I'm sorry, I should clarify - ANY ONE of the listed solutions seemed to
fix the refresh (adding all three would seem excessively redundant!)

Good Luck - Mike

Other Threads