chongkeng_woon
asked on
DBGrid Editing
I hope to enter a value for particular field in a DBGrid, the problem is i can't enter(or edit) it when i run the program
i have set the properties dgEditing = True (in Options)
, but i still failed. Anyidea ??
i have set the properties dgEditing = True (in Options)
, but i still failed. Anyidea ??
ASKER
Nope, it doesn't work. I set the
DBGrid connected to a DataSource1, while DataSource1 is connected(dataset) to a query, a query is connected to a database, i put RequestLive=True, but, no luck
DBGrid connected to a DataSource1, while DataSource1 is connected(dataset) to a query, a query is connected to a database, i put RequestLive=True, but, no luck
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
in runtime, requestlive is true, but tquery.canmodify is false, i think that why i got it readonly, but how to make the data editable when tquery.canmodify is false ????
Hi,
can you show me your SQL statement?
----
Igor.
can you show me your SQL statement?
----
Igor.
ASKER
Igor:
sql.add('select p.* from print p');
sql.add('join printtext pt');
sql.add('on p.number=pt.number');
sql.add('and p.prefix=pt.prefix');
sql.add('where pt.id = :id');
sql.add('and pt.personid = :personid');
thanks
sql.add('select p.* from print p');
sql.add('join printtext pt');
sql.add('on p.number=pt.number');
sql.add('and p.prefix=pt.prefix');
sql.add('where pt.id = :id');
sql.add('and pt.personid = :personid');
thanks
Ok, I see. I was right, it's multiply table join and can't be edited directly.
Take a look at Delphi help:
<<
All multi-table queries return read-only result sets. Other conditions may cause a query to return a read-only result set. For local tables (such as dBASE and Paradox), see the local SQL help file for rules governing live result sets (updatable queries). For other table types (such as InterBase, Oracle, and Sybase), consult the documentation for the specific database system.
>>
Use TUpdateSQL to solve your problem.
Regards,
Igor.
Take a look at Delphi help:
<<
All multi-table queries return read-only result sets. Other conditions may cause a query to return a read-only result set. For local tables (such as dBASE and Paradox), see the local SQL help file for rules governing live result sets (updatable queries). For other table types (such as InterBase, Oracle, and Sybase), consult the documentation for the specific database system.
>>
Use TUpdateSQL to solve your problem.
Regards,
Igor.
if DBGrid connected to TQuery then set query's property RequstLive = true. In case you using TTable be sure that table's property ReadOnly = False;
-----
Igor.