Solved

Delphi Programming question

Posted on 1997-09-11
6
180 Views
Last Modified: 2010-04-04
I've got a DBGrid in which several titles are listed with their media (CD,LP,MC). I've made the Datasource of the grid a Query,because the titles are linked to a media DBFile using a Media_ID field. (I wanted the  name of the medium appear in the GRID rather than the ID,so I thought I had to use a Query here). But updating a record is now causing a problem,because the Query is readonly. Is there a standard solution for this sort of problem?
0
Comment
Question by:lizzzard
6 Comments
 
LVL 1

Expert Comment

by:CFantin
ID: 1344687
Can you give a bit more detail.

I understand this as you having 2 tables that are linked together
in the query. You need to display fields from both querys. When you update the dbgrid you want to update the appropriate tables.

0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1344688
try to set the property 'RequestLive' to true
0
 
LVL 1

Expert Comment

by:CFantin
ID: 1344689
The reason you cannot set the Query RequestLive to true is because you are selecting from multiple tables.

You can look at the cached updates and the UpdateSQL component.
I do not have time to sort out example code but if you look at those you may be able to figure out how to do it.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:lizzzard
ID: 1344690
Ronit:I already did that,but it don't work. Thanks for the suggestion though.
CFantin:OK,the situation is as follows:
      
      File1:Sources           File2:Media
      Source_ID                     
      Source_Medium    --->      Medium_ID      
      Source_Title             Medium_Name
      enz..

In the DBGrid I want listed: Source_ID Source_Title Medium_Name
Now I want the user to be able to update the record in the DBGrid,if it is possible using a DBListbox for looking up the Source.
Thanks for your help
0
 
LVL 1

Expert Comment

by:CFantin
ID: 1344691
Sorry but I cannot help!
No time.


0
 

Accepted Solution

by:
kwang080897 earned 50 total points
ID: 1344692
Use a Ttable as database source. In the field editor add a new field and make it a lookupfield. point it to the secondary table like this:

Dataset=Media
Keyfield=Source_medum
Lookupfield=Medium_id
Resultfield=Medium.name

Remember to setup a Fieldname,Fieldtype+size for the new field.

This will also give you a dropdown list when you click
(or dubbleclick) in the dbgrid

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now