Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Refresh Of Lookup List on DBGrid

Posted on 2002-04-02
9
Medium Priority
?
1,379 Views
Last Modified: 2010-05-18
Hi
Wonder if any of u can help.

I am working on D5 Enterprise, using ADO components to connect and manipulate an Access 2000 database.

Setup is as follows:
FormA has DBGrid with datasource, adoconnection, adotable components looking at an Access table.

FormB has DBGrid with datasource, adoconnection, adotable components looking at the related table.

One of the fields is a foreign key to another table, so I set up a lookup list using a calculated lookup field. I set the app up so that if the user currently has focus on this lookup field on FormA, then by pressing a command button they call another form (FormB) to edit the contents of the related table. When the user closes this form they are taken back to FormA and the dbgrid should update to reflect the users changes -- the problem is its not updating. It does if I close the app and re open it, but this is obviously not what I want. I've tried refreshes, requerys, closing the connection and reopening it, all fail. Am I:

a) not attacking this in the correct way,
b) addressing a bug,
c) missing something

any ideas please.


Regards
Cardiod
0
Comment
Question by:cardiod
[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
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 6912614
simple

adotable.requery;

a sample from one of my current project
(also ado, also access)
if the gridcolumn (uses quantumgrid of devexpress)
is clicked,
a lookupsource, editwindow come up

procedure TfrmFlyTime.dbgZDetailColumnClick(Sender: TObject; Column: TdxDBTreeListColumn);
begin
  If Column.Field.FieldName = 'ZEITEN_TYPLookUp' then
    with tfrmZeitTyp.Create(Self) do
    try
      tblZEIT_TYP.Active := True;
      ShowModal;
    finally
      Release;
    end;
  tblZeitTyp.Requery;
end;

this works for me fine

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6912622
meant if the gridcolumntitle is clicked :-)
0
 
LVL 17

Expert Comment

by:geobul
ID: 6912642
Hi,
I think the problem is that the current record on FormB.ADOTable remains unchanged after update. So a possible solution could be:
---
...
FormB.ShowModal;
FormB.ADOTable1.Last;
FormB.ADOTable1.First;
FormA.ADOTable1.Refresh;
---

Regards, Geo
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:cardiod
ID: 6912939
Thanks for the quick replys kretzschmar and geobul

I have tried both solutions and they don't work for me. geobul: The data is changing in FormB Ive checked at runtime.

Kretzschmar: I have tried refreshes, requeries, resetting Active, closing the connection and reopening it. They all seem to fail. Are you using the ado components that came with with D5 Enterprise? The only other thing I can check on is subtle differences in set up between your working copy and mine. I have tried your code, it is not too much different in how I do it, I have the connection active set at design time, and this doesn't work either.

Thanks

Cardiod
0
 

Author Comment

by:cardiod
ID: 6913114
Hi Kretzschmar, geobul

Seemed to have solved it myself. The property Tansliterate was set to true for the calculated lookup field. setting to false works. Apparently its a translator switch between ANSI characters set and the character set used by the database. The only other thing I have to do is force a refresh of the lookup data on FormB.

This setting is not obvious on connection help files. No wonder people (non experts) like me get confused so easily!

I would like to thank you both for your quick replys.

Regards

Cardiod


0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6913128
never guessed that,
glad you got it work

ask at community support for keep this q into paq
and refunding your points

meikl ;-)
0
 

Expert Comment

by:ComTech
ID: 6915338
Hello all, cardiod has asked in Community Support that this question be placed in PAQ.  He would also like to
award each of you 50 points.

50=kretzschmar
50=geobul

I have reduced the amount of points to 50 to award one Expert here, and will create a new quesstion for geobul in this same Topic Area.

This will finalize and PAQ this question.

Thanks and regards,
ComTech
CS Admin @ EE
0
 

Expert Comment

by:ComTech
ID: 6915356
geobul your points can be picked up here.

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=delphi&qid=20284413 

ComTech
0
 
LVL 17

Expert Comment

by:geobul
ID: 6917564
Thanks, Cardiod.

Regards, Geo
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

610 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