Autor Beitrag
csigg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Di 05.07.05 13:23 
Ich hab in einer Form folgenden aufruf:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
sqlstatement := 'SELECT * FROM MITARBEITER WHERE NAME='''+name+''' AND VORNAME='''+vorname+'''';
with dmMesse.qryMitarbeiterAuswahl do
begin
    close;
    SQL.clear;
    SQL.Add(sqlstatement);
    open;
end;
frm_Main.Visible := true;
frm_NLMitarbeiter.Visible := false;
ShowMessage('bla1bla');

frm_Main.prc_sucheMitarbeiter(2);

ShowMessage('bla2bla');
ModalResult := mrOK;
end;

prc_MitarbeiterSuche in einer anderen Form im gleichen Projekt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
begin
 if native > 0 then
 begin
    with dmMesse.qryMitarbeiterAuswahl do
    begin
      tvname := FieldByName('Vorname').asstring;
      tnname := FieldByName('Name').asstring;
      tmanr := FieldByName('MAnr').asstring;
      //tbst := FieldByName('NLNR').asstring;
     end;
       ShowMessage(tvname);
     tage := '';
     sqlstatement := 'SELECT * FROM ANWESENHEIT WHERE MANR='+ tmanr +'';
          ShowMessage(sqlstatement);
     with dmMesse.qryAnwesenheit do
     begin
      close;
      SQL.Clear;
      SQL.Add(sqlstatement);
      Open;
       ShowMessage('bla00bla');
      while not EOF do
      begin
          datum := StrToDate(FieldByName('DATUM').asstring);
          von := StrToTime(FieldByName('UHRZEITVON').asstring);
          bis := StrToTime(FieldByName('UHRZEITBIS').asstring);

Allerdings steht in tvname/tnnmae und tmanr nix drin. Wenn ich die entsprechenden Statements direkt im SQL Editor ausprobiere klappt es ohne Probleme.
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 06.07.05 07:54 
Hat sich erldeigt, es funktioniert jetzt, war ein kleiner Fehler im SQL Statement
Amiga-Fan
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Mi 06.07.05 08:28 
Zitat:
NAME='''+name+''' AND


mach daraus ein NAME='+quotedstr(name)+'AND

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
csigg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 706

WIn XP, Win NT, Win2000, Suse8.0
Delphi 5, Delphi 6
BeitragVerfasst: Mi 06.07.05 08:34 
OK, danke.
Mir gefallen die vielen Hochkammas auch nicht, wusste aber nicht wie es anders geht.