Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

DBGrid Editing

Posted on 2001-09-12
8
369 Views
Last Modified: 2010-04-06
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 ??
0
Comment
Question by:chongkeng_woon
  • 4
  • 3
8 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 6476299
Hi chongkeng_woon,

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.
0
 
LVL 3

Expert Comment

by:VSF
ID: 6476339
Or u may try using a stringgrid!

VSF
www.victory.hpg.com.br
0
 

Author Comment

by:chongkeng_woon
ID: 6476371
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
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 9

Accepted Solution

by:
ITugay earned 70 total points
ID: 6476378
Hi chongkeng_woon,

check TQuery.RequestLive in runtime. There may be readonly resultset returned by TQuery (e.g. multiply tables join).

----
Igor.
0
 

Author Comment

by:chongkeng_woon
ID: 6476610
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 ????

0
 
LVL 9

Expert Comment

by:ITugay
ID: 6478895
Hi,

can you show me your SQL statement?

----
Igor.
0
 

Author Comment

by:chongkeng_woon
ID: 6484187
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
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6487012
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.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 166
Newbie Thread Programming 1 161
select query - oracle 16 100
Delphi Ado Query To Converts Joined Columns Into Rows Based on Primary Key 4 68
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 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