Solved

Delphi 3 refreshing Query

Posted on 1998-01-09
2
191 Views
Last Modified: 2012-05-04
I want to know how to refresh a single record on a query already prepared and executed. When executing the query.refresh I get the error : "Index not unique"
The database I am working with is MS SQL Server.
0
Comment
Question by:MONROE
2 Comments
 
LVL 3

Accepted Solution

by:
Pegasus100397 earned 60 total points
ID: 1356006
Monroe,

  You can't really refresh just a single record unless the query only returns that one record. The Index Not Unique error is coming up because Delphi needs a unique index on the tables it accesses in order to be able to tell which one it was updating.

Go to the table and prepare a unique index and let your app know what it is. Should solve the problem.

Good luck on your project!
Pegasus
0
 

Author Comment

by:MONROE
ID: 1356007
Perhaps I have forgotten something but On the MS SQL Server Entreprise Manager, I have set my tables with a unique index and on Delphi I have tried a simple program with a query, a DBNavigator and a DBGrid connected with a datasource. The result on pressing the refresh button of the DBNavigator was this error "Cannot refresh this table because there is no unique index". Am I obliged to put only a Table component to use this refresh utility. Why is it so accessible for queries? Or what must I do to do it works? You say : Let your app know what it is => I don't know how...

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question