Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Delphi Programming question

Posted on 1997-09-11
6
Medium Priority
?
189 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 100 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

886 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