Solved

Delphi Programming question

Posted on 1997-09-11
6
184 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
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!

 

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

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
Delphi inherited method 6 89
Performance of SQL statement 37 148
Dev express lookupcombo 3 64
With Delphi XE10, how to use .Manifest file on WIndows 10 Machines 3 63
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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

710 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