Autor Beitrag
jerilynn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22



BeitragVerfasst: Di 14.03.06 10:46 
Hallo,

ich versuche zur Zeit eine Datenbankanwendung zu erstellen (meine erste^^). Dazu benutze ich Firebird Embedded, die ZEOS Komponenten und Delphi 7. Auf meinem Formular befindet sich eine ZConnection und eine ZQuery Komponente. Am Anfang erstelle ich eine Datenbank und initialisiere sie:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
ZConnection.Database := 'xmaster.fdb';
ZConnection.Protocol := 'firebird-1.5';

if not FileExists('xmaster.fdb' then
begin
  ZConnection.Properties.Add('CreateNewDatabase=CREATE DATABASE ' +
                             QuotedStr('xmaster.fbd' + ' USER ' +
                             QuotedStr('sysdba') + ' PASSWORD ' + QuotedStr('masterkey') +
                             ' PAGE_SIZE 4096 DEFAULT CHARACTER SET ISO8859_1');
end;

ZConnection.User := 'sysdba';
ZConnection.Password := 'masterkey';

ZConnection.Connect;


Danach erstelle ich eine Tabelle:

ausblenden Delphi-Quelltext
1:
2:
3:
ZQuery.SQL.Clear;
ZQuery.SQL.ADD('CREATE TABLE test (a INTEGER)');
ZQuery.ExecSQL;


Wenn der Typ in der Tabelle ein INTEGER ist funktioniert das auch ohne Probleme. Möchte ich nun folgenden Code ausführen:

ausblenden Delphi-Quelltext
1:
2:
3:
ZQuery.SQL.Clear;
ZQuery.SQL.ADD('CREATE TABLE test (a CHAR(26))');
ZQuery.ExecSQL;


kommt die Fehlermeldung SQL Error: unsuccesful metadata update TEST. Error Code: -607- This operation is not defined for system tables. Kann mir jemmand bei diesem Fehler helfen? *schonmal danke im vorraus^^*

grüße Lynn
cherry
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 136

WinXP - Professional
RAD Studio 2009
BeitragVerfasst: Di 14.03.06 13:31 

_________________
AM I TOO SEXY?
Ist das nur mein Gefühl, oder ist die ganze Welt verrückt geworden!?
jerilynn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22



BeitragVerfasst: Di 14.03.06 13:53 
Das auf der Website scheint nichts mit meinem Problem zu tun zu haben und wenn doch, dann bitte mal kurz erklären. Danke.

Lynn
cherry
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 136

WinXP - Professional
RAD Studio 2009
BeitragVerfasst: Di 14.03.06 14:25 
Sorry, war grad im falschen Film :lol:

Ehrlich gesagt habe ich keine Ahnung hatte noch nie was mit dieser Datenbank zu tun.

- schon mal mit einer anderen Länge versucht? char(20)
- was ist mit varchar(20) geht dies auch nicht?

laut beschreibungen zu Firebird sollte dies eigentlich schon funktionieren.

_________________
AM I TOO SEXY?
Ist das nur mein Gefühl, oder ist die ganze Welt verrückt geworden!?
jerilynn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22



BeitragVerfasst: Di 14.03.06 15:00 
Nein das bringt alles nichts. Es kommt immer die oben beschriebende Fehlermeldung.

Lynn