Board index » delphi » Help! - Refreshing datasets with MSSQL 6.5

Help! - Refreshing datasets with MSSQL 6.5

Hello,

    I am experiencing a problem with refreshing a dataset.

    I am using D3 professional and MS SQL 6.5.

    Using the TTable object I opened a table in the database, but if I
try to refresh the table I get "Table does not support this operation
because it is not uniquely indexed" error message . I created a unique
index (which I can see exists through the SQL Admin. and Borland
Database explorer) but still I get the same error.

What is wrong?

Thank you, Eran.

 

Re:Help! - Refreshing datasets with MSSQL 6.5


Quote
Rami Atia wrote:
>     Using the TTable object I opened a table in the database, but if I
> try to refresh the table I get "Table does not support this operation
> because it is not uniquely indexed" error message . I created a unique
> index (which I can see exists through the SQL Admin. and Borland
> Database explorer) but still I get the same error.

A) Avoid TTables

B) You need not only a unique index, but a PRIMARY KEY

--
Chad Z. Hower - Surgoinsville, TN
"Programming is an art form that fights back"
Free Delphi, CGI and other things at: http://www.pbe.com/Kudzu

Re:Help! - Refreshing datasets with MSSQL 6.5


Thank you for your reply.

   I have tried to use primary key, but still I can not refresh the dataset.
Also when viewing the table
structure using the Database Explorer from Borland, It doesn't recognize
that the table has a primary key, but using the SQL admin. tool on the
server I can see that the primary key was created successfully.

 I have created the primary key when creating the table using SQL script on
the SQL server.

What am I doing wrong?

Thanks,
Eran.

Quote
Chad Z. Hower wrote:
> Rami Atia wrote:

> >     Using the TTable object I opened a table in the database, but if I
> > try to refresh the table I get "Table does not support this operation
> > because it is not uniquely indexed" error message . I created a unique
> > index (which I can see exists through the SQL Admin. and Borland
> > Database explorer) but still I get the same error.

> A) Avoid TTables

> B) You need not only a unique index, but a PRIMARY KEY

> --
> Chad Z. Hower - Surgoinsville, TN
> "Programming is an art form that fights back"
> Free Delphi, CGI and other things at: http://www.pbe.com/Kudzu

Re:Help! - Refreshing datasets with MSSQL 6.5


Quote
Rami Atia wrote:
> Thank you for your reply.

>    I have tried to use primary key, but still I can not refresh the dataset.
> Also when viewing the table
> structure using the Database Explorer from Borland, It doesn't recognize
> that the table has a primary key, but using the SQL admin. tool on the
> server I can see that the primary key was created successfully.

>  I have created the primary key when creating the table using SQL script on
> the SQL server.

> What am I doing wrong?

Nothing. The only way to refresh a SQL based dataset is to close it and tha open
it again.
Quote
> Thanks,
> Eran.

> Chad Z. Hower wrote:

> > Rami Atia wrote:

> > >     Using the TTable object I opened a table in the database, but if I
> > > try to refresh the table I get "Table does not support this operation
> > > because it is not uniquely indexed" error message . I created a unique
> > > index (which I can see exists through the SQL Admin. and Borland
> > > Database explorer) but still I get the same error.

> > A) Avoid TTables

> > B) You need not only a unique index, but a PRIMARY KEY

> > --
> > Chad Z. Hower - Surgoinsville, TN
> > "Programming is an art form that fights back"
> > Free Delphi, CGI and other things at: http://www.pbe.com/Kudzu

Re:Help! - Refreshing datasets with MSSQL 6.5


I have seen the same results (unrecognized primary key) in Database
Explorer when connecting via ODBC driver/DSN.  I also could not edit the
database structure via the explorer.  When I use an alias that uses a
Borland native driver the metadata is reflected in the Database Explorer
correctly and I can modify the database.  Tech support explained that not
all ODBC drivers allow database updates via Database Explorer.  Borland
native drivers make direct API calls to the DB Server and thus performance
and error reporting is more accurate. (I was also experiencing ambiguious
errors while using my Delphi program,  which where reported more accurately
when I switched drivers)

Rami Atia <r...@carpetmaster.com> wrote in article
<35C0DA96.B02E0...@carpetmaster.com>...

Quote
> Thank you for your reply.

>    I have tried to use primary key, but still I can not refresh the
dataset.
> Also when viewing the table
> structure using the Database Explorer from Borland, It doesn't recognize
> that the table has a primary key, but using the SQL admin. tool on the
> server I can see that the primary key was created successfully.

>  I have created the primary key when creating the table using SQL script
on
> the SQL server.

> What am I doing wrong?

> Thanks,
> Eran.

Other Threads