Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Sa 06.11.04 13:09 
Liebe Helpher,

ich habe eine Datenbank eingerichtet. Zu dieser Datenbank gehören drei Tabellen.

Wie kann ich eine vierte Tabelle hinzufügen? (Es sind alles Foxpro-Tabellen)


[Nicht! lachen]

Viele Grüße, Detlef Annies
greg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 119

Windows2000, WindowsXP
D5 Prof
BeitragVerfasst: Sa 06.11.04 14:42 
Hallo Annies oder D. ?

wie auch immer, ich hab sowas mal mit Paradox-Tabellen gemacht. Das sollte im Prinzip eigentlich gleich gut Funktionieren. Ich kopier mal ein Stückchen aus meinem Program:
ausblenden volle Höhe 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:
27:
28:
29:
30:
31:
32:
33:
procedure TForm1.Button1Click(Sender: TObject);
var T : TTable; S : TSession; i : Integer;
begin
  T := TTable.Create(Self);                        // Objekt erzeugen
  S := TSession.Create(Self);
  T.DatabaseName := '.\DB';                        // Datenbank zuweisen
  T.TableType := ttParadox;                        // Typ festlegen
  T.TableName := 'NeueTabelle';                    // Tabellenname zuweisen
  with T.FieldDefs do begin
    Clear;
    Add('Index_ID', ftAutoInc, 0, True);           // Zählerfeld
    Add('Nummer1', ftInteger, 0, False);
    Add('String1', ftString, 30, False);
    Add('Zeit1', ftTime, 0, False);
    Add('Memo', ftMemo, 1, False);
    Add('JaNein', ftBoolean, 0, False);
  end;
  with T.IndexDefs do begin
    Clear;
    with AddIndexDef do begin
      Name := '';
      Fields := 'Index_ID';
      Options := [ixPrimary, ixUnique];
    end;
  end;
  try
    T.CreateTable;                                 // Versuch, die Tabelle zu erzeugen
  except
    showmessage('Tabelle konnte nicht erzeugt werden!');
    exit;
  end;
  showmessage('Tabelle wurde erzeugt ...');
end;


Hier lacht doch keiner. Ich denke nicht, dass es jemanden gibt, der für jede Aufgabenstellung eine Lösung parat hat. Und Anfänger sind wir auch alle mal gewesen.

Gruß
Gregor
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Sa 06.11.04 18:03 
Hi, Gregor,

dank für deine Antwort, aber der Knackpunkt ist wohl TType = FoxPro.
Dann wird gesagt, foxpro ist dbase mit Level = 25 uswusf. Nichts geht wirklich.

So warte ich auf einen Leser, der sich schon gut mit Foxpro gequält hat!

Grüße aus Lübeck, Detlef Annies
jaevencooler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 166
Erhaltene Danke: 6

MS-DOS,Win32, Win95, Win 98, Me,XP, Linux, NT4.0, NT 2000-2008, Vista, Windows 7
Turbo Pascal,D1 Enter,D2 Enter,D3 Enter,D5 Enter, Kylix, D2007, PL/SQL, MS/SQL, Delphi 2010, Delphi XE
BeitragVerfasst: Di 09.11.04 16:49 
Moin,

die einfachste Art und Weise ist es wohl die Tabelle mit SQL anzulegen,
z.B: create table test usw.

Hilfe zu Ansi SQL findest Du in der Delphi Hilfe, bei Google oder bei OBI...

Gruß
Michael