Board index » delphi » Updating table using DBGrid/DBNavigator

Updating table using DBGrid/DBNavigator

I need help deleting rows from a dbgrid.  The dbgrid has a datasource -
DS_AllTime.  DS_Alltime has a datasource TDS_TimeDataSource which is assigned
to table Tbl_Time.  The dbgrid is populated from query - AllTime which has a
datasource DS_AllTime.  The query selects all of the time from the time table
and employee information (i.e. last name, first name, etc.) from the empinfo
table.  The update method for DS_AllTime is a update Sql which has a delete sql
to delete the time from the time table.  Request Live = True and Cached Updates
= True.  Now, when I tell press the delete button on the dbnavigator and
confirm the delete, the updateerror is triggered and a message appears saying
the table is read only.  What is going on???  I have only been using Delphi for
about 10 days so HELP!!!
Thanks In Advance,
Donna

 

Re:Updating table using DBGrid/DBNavigator


Donna,

This won't work the way you are trying. Check the book on the TQuery
component: you can't have a live query if it gets data from two
tables. Delphi will automatically give you a readonly dataset. The
usual way to handle this is to use TUpdateSQL.

I presume this is because there is no guarranteed way to go
*backwards* through the query to change the correct records.

HTH
Dan
On 12 Feb 1998 02:14:36 GMT, gti...@aol.com (GTiley) wrote:

Quote
>I need help deleting rows from a dbgrid.  The dbgrid has a datasource -
>DS_AllTime.  DS_Alltime has a datasource TDS_TimeDataSource which is assigned
>to table Tbl_Time.  The dbgrid is populated from query - AllTime which has a
>datasource DS_AllTime.  The query selects all of the time from the time table
>and employee information (i.e. last name, first name, etc.) from the empinfo
>table.  The update method for DS_AllTime is a update Sql which has a delete sql
>to delete the time from the time table.  Request Live = True and Cached Updates
>= True.  Now, when I tell press the delete button on the dbnavigator and
>confirm the delete, the updateerror is triggered and a message appears saying
>the table is read only.  What is going on???  I have only been using Delphi for
>about 10 days so HELP!!!
>Thanks In Advance,
>Donna

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control: Consulting, Software,
and the only comprehesive textbook on this subject.
visit us at www.cmdcsystems.com
[Remove the SPAM from my e-mail address]

Other Threads