Autor Beitrag
NTM
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 120

Win XP
2005 Prof
BeitragVerfasst: Mi 22.11.06 08:29 
Hallo zusammen,
ich habe eine Acesse Datenbank mit ADOQuery greife ich auf die Datenabnk drauf zu.
Nun habe habe ich Form wo von verschieden Tabel der Datenbank Informationen Anzeigt werden. Nun möchte ich wenn ich auf Speichern drücke das alle Informationen die gerade Angezeigt werden in einer anderen Tabelle der Datenbank kopiert werden.

Könnte mir da einer Helfen.

P.S.
Es werden aus 4 Tabellen Informationen angezeigt falls das wichtig ist.
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 22.11.06 08:34 
Guten Morgen!

Was verwendest du zur Visualisierung der Daten? DBGrid? Falls ja: Sehr gut =)

Deine Vorgehensweise:

1. Verbindung zur anderen DB/Table herstellen
2. Deine Daten Schritt um Schritt (Zeile für Zeile) durchgehen und deine Daten in neue mit
Insert "kopieren"

LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
NTM Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 120

Win XP
2005 Prof
BeitragVerfasst: Mi 22.11.06 08:59 
Hallo Stefan,
sorry na klar meinte ich DBGrid.
Was meinst Du mit Zeile für Zeile?.
Sorry ich stehe heute etwas auf der Leitung hatte eben einen VKU mit meinen Wagen.
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 22.11.06 09:05 
Musst dich nicht entschuldigen

So ungefähr:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
function copyData: boolean;
var i: integer;
begin
 copyData:= false;

 for i:= 1 to deinDBGrid.datasource.dataset.recordcount do
 begin
  deinNeuesQuery.sql.text:= 'Dein INSERT-Statement mit Zugriff auf DBGrid.fields';
  try
   deinNeuesQuery.execsql;
  except
   on e: exception do
   begin
    messagebox(application.handle, e.message, 'Fehler bei SQL', MB_IconERROR);
    exit;
   end;
  end;
  deinDBGrid.datasource.dataset.moveby(1);
 end;
 copyData:= true;
end;


LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.


Zuletzt bearbeitet von ZeitGeist87 am Mi 22.11.06 09:09, insgesamt 1-mal bearbeitet
NTM Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 120

Win XP
2005 Prof
BeitragVerfasst: Mi 22.11.06 09:07 
Danke für deine Hilfe