Autor Beitrag
delphisual
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 89

WIN 2000
D5 Prof
BeitragVerfasst: Do 11.01.07 17:32 
Hallo zusammen, ich habe ein Problem und hoffe, dass mir hier geholfen werden kann.
Ich habe ein Query die im Verbindung mit einer Datenbank steht, nun möchte ich bei dem Ereignis BeforeInsert erreichen, dass der Datensatz nicht in die Datenmenge eingefügt wird da bereits ein Datensatz in dem Tabelle drin steht. Kann mir vielleicht jemand sagen wie ich das am besten hinbekomme?

so habe ich das Versucht:

ausblenden Quelltext
1:
if tempQuery.RecordCount then  DataSet.Cancel();					


Vielen Dank!
delphisual

_________________
(Wer ein Problem definiert, hat es schon halb gelöst.)
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 11.01.07 18:28 
Welche Datenbank?

_________________
Markus Kinzler.
delphisual Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 89

WIN 2000
D5 Prof
BeitragVerfasst: Do 11.01.07 19:00 
Die Datenbank ist oracle 8i.

_________________
(Wer ein Problem definiert, hat es schon halb gelöst.)
delphisual Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 89

WIN 2000
D5 Prof
BeitragVerfasst: Do 11.01.07 20:38 
Wenn jemand das gleiche Problem haben sollte, das hier kann helfen:

ausblenden Quelltext
1:
2:
3:
4:
procedure MyQuery.BeforeInsert(Sender: TDataSet);
begin
  Abort;
end;


cu

_________________
(Wer ein Problem definiert, hat es schon halb gelöst.)
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 11.01.07 22:10 
Man könnte auch einen Trigger verwenden
de.wikibooks.org/wiki/Oracle:_Trigger

_________________
Markus Kinzler.