Solved

Delphi Programming question

Posted on 1997-09-11
6
185 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
[X]
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
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month9 days, 14 hours left to enroll

624 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