[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

Master/Detail

How can i make master/detail using
TQuery and i want mytable query can save,cancel,delete,append .
I want detail that syntax and
the related properties which influence
that Query

thanks
0
hertanto
Asked:
hertanto
  • 2
1 Solution
 
daniel_cCommented:
Why don't use TTable instead of TQuery and use Filter for Subtitution of 'WHERE' in TQuery?
Anyway, if you use TQuery as the backbone of your dbGrid, you can't do any data manipulation(Add/Save/Delete/Append).
0
 
AlphomegaCommented:
I have found that on Inprise.com:

   NUMBER  :  2895
  PRODUCT  :  Delphi
  VERSION  :  1.0
       OS  :  Windows
     DATE  :  May 21, 1996                          

    TITLE  :  How to check for app already running.

Q:  How can I write my Delphi program to detect if there is
already another copy running and exit if so?

A:  Create a unit called PrevInst and add it to your uses clause.  
Here's the code:

 unit PrevInst;

 interface

 uses
  WinTypes, WinProcs, SysUtils;

 type
  PHWND = ^HWND;
  function EnumFunc(Wnd:HWND; TargetWindow:PHWND): bool; export;
  procedure GotoPreviousInstance;

 implementation

  function EnumFunc(Wnd:HWND; TargetWindow:PHWND): bool;

  var
    ClassName : array[0..30] of char;
  begin
    Result := true;
    if GetWindowWord(Wnd,GWW_HINSTANCE) = hPrevInst then
    begin
      GetClassName(Wnd,ClassName,30);
      if StrIComp(ClassName,'TApplication') = 0 then
      begin
        TargetWindow^ := Wnd;
        Result := false;
      end;
    end;
  end;

  procedure GotoPreviousInstance;
  var
    PrevInstWnd : HWND;
  begin
    PrevInstWnd := 0;
    EnumWindows(@EnumFunc,longint(@PrevInstWnd));
    if PrevInstWnd <> 0 then

      if IsIconic(PrevInstWnd) then
        ShowWindow(PrevInstWnd, SW_RESTORE)
      else
        BringWindowToTop(PrevInstWnd);
  end;

  end.

And then make the main block of your *.DPR file look
something like this--

begin
  if hPrevInst <> 0 then
    GotoPreviousInstance
  else
  begin
    Application.CreateForm(MyForm, MyForm);
    Application.Run;
  end;
end.

0
 
kretzschmarCommented:
hi Alphomega,

seems, that you missed the right q ;-)

hi hertanto,
please evaluate my answer in your q
http://www.experts-exchange.com/bin/Q.10229933

before i give you additional advise to this q
(there are more ways possible)

meikl ;-)
0
 
AlphomegaCommented:
Sorry for my mistake ...

Alph...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now