Autor Beitrag
nooby
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP Pro.
D7
BeitragVerfasst: Mo 18.10.04 19:07 
Hallo,

ich such jetzt schon seit Stunden nach einer Lösung, aber ich komme irgendwie nicht weiter. Ich versuche mit Delphi und Zeos eine Firebird-Datenbank zu erstellen. Ich habe hierfür auch einige Hilfe gefunden, nur leider funktioniert davon nix richtig.

Hier mein Code Version 1:

ausblenden Delphi-Quelltext
1:
2:
3:
ZConnection1.Protocol := 'firebird-1.5';
ZConnection1.Properties.Add('CreateNewDatabase="D:\Daten\CD-Daten\Programmierungen\Zeos_Firebird_Test Test.gdb"');
ZConnection1.Connect;


und mein Versuch 2:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
ZConnection1.Database := 'D:\Daten\CD-Daten\Programmierungen\Zeos_Firebird_Test Test.gdb';// Path to Database
ZConnection1.HostName := 'localhost';
ZConnection1.Password := 'masterkey';
ZConnection1.User := 'SYSDBA';
ZConnection1.CreateDatabase;


wie gesagt, es funktionieren beide nicht. Was mache ich falsch??

Moderiert von user profile iconUGrohne: Delphi-Tags korrigiert.
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Mo 18.10.04 20:11 
Versuch mal als DatabaseName localhost:D:\Daten\CD-Daten\Programmierungen\Zeos_Firebird_Test\Test.gdb

Ich weiß nicht, ob ZEOS das korrekt mit Firebird macht, da FB keine lokalen Connections zulässt.
nooby Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP Pro.
D7
BeitragVerfasst: Mo 18.10.04 20:39 
Nein, das funktioniert auch nicht.

Ich habe noch ein paar Angaben dazu gemacht, aber es kommt beim Connect immer folgende Fehlermeldung:


SQL Error: invalid database handle (no active connection). Error Code: -904. Unsuccessfull execution caused by an unavailable resource. The SQL:
D:\Daten\CD-Daten\Programmierungen\Zeos_Firebird_Test Test.gdb;


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
  ZConnection1.HostName := 'localhost';
  ZConnection1.Password := 'masterkey';
  ZConnection1.Protocol := 'firebird-1.5';
  ZConnection1.User := 'SYSDBA';
  ZConnection1.Properties.Add('CreateNewDatabase=D:\Daten\CD-Daten\Programmierungen\Zeos_Firebird_Test Test.gdb');
// alternativ:
// ZConnection1.Properties.Add('CreateNewDatabase=localhost:D:\Daten\CD-Daten\Programmierungen\Zeos_Firebird_Test Test.gdb');
  ZConnection1.Connect;


P.S. Connect zu einer bestehen DB geht ohne Probleme.

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 18.10.04 21:26 
Es ist immer wieder dasselbe. 8) Will man einen bestimmten Zweck erreichen, so sollte man sich zuallererst das passende Werkzeug suchen. Mit Delphi die Datenabank anzulegen, das ist ungefähr so was, wie mit einer Gabel statt eines Hammers einen Nagel in die Wand zu kloppen. Ja, irgendwann wirds schon gehen. :mrgreen:

_________________
Gruß
Hansa
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 19.10.04 09:02 
Hat Dein Programm Zugriff auf die FB-Dll?
mettie84
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 21

Win2k, XP SP2, Linux 9.0
D5 standart, D6 Ent, D7 Ent
BeitragVerfasst: Di 19.10.04 09:06 
Hast du schonmal probiert anstatt 'localhost' die Loopback-Adresse anzugeben (127.0.0.1)? Ich habe die Erfahrung gemacht, dass die ZeosLibs stellenweise Probleme haben mit der Netzwerknamenauflösung. Gib das Verzeichnis mal so an:
127.0.0.1//D:/Daten/CD-Daten/Programmierungen/Zeos_Firebird_Test Test.gdb


MfG Matthias[
Lemmy
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 792
Erhaltene Danke: 49

Windows 7 / 10; CentOS 7; LinuxMint
Delphi 7-XE10.1, VS 2015
BeitragVerfasst: Di 19.10.04 10:34 
HI,

hast Du schon mal dieses Tuto hier angeschaut:

www.delphi-tutorials.de/Tutorials/ZEOS.ZIP

Grüße
Lemmy
nooby Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44

Win XP Pro.
D7
BeitragVerfasst: Di 19.10.04 17:28 
@ UGrohne:

Ja, hat Zugriff auf dll.

@ mettie84:

Hab ich probiert. Fehler bleibt der gleiche.

@ Lemmy:

Ja, ich kenne dieses Tuto. Daran hab ich mich ja auch erst mal orientiert. Aber er tut halt nix.
Lemmy
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 792
Erhaltene Danke: 49

Windows 7 / 10; CentOS 7; LinuxMint
Delphi 7-XE10.1, VS 2015
BeitragVerfasst: Mi 20.10.04 06:14 
Guten Morgen,

dann setz Dich doch bitte mit dem Verfasser des Tutos in Verbindung! Er sollte Dir eigentlich weiterhelfen können!!

Grüße
Lemmy
Domo Sokrat
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 21

W7
VS2010 pro / #D 4.2 / Delphi 2006 pro
BeitragVerfasst: Mo 25.10.04 19:51 
Fehler von mir! Sorry! :oops:

So geht's:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
:
ZConnection1.Database := 'd:\db1.fdb';
ZConnection1.Protocol := 'firebird-1.5';
ZConnection1.Properties.Add ('CreateNewDatabase=CREATE DATABASE ' +
   QuotedStr ('d:\db1.fdb') + ' USER ' +
   QuotedStr ('sysdba') + ' PASSWORD ' + QuotedStr ('masterkey') +
      ' PAGE_SIZE 4096 DEFAULT CHARACTER SET ISO8859_1');
   ZConnection1.Connect;
:


Es müssen aber zuvor mindestens die Properties Database und Protocol gesetzt werden (auch über den Objektinspektor möglich).

@Lemmy: Hi! Lange nichts mehr voneinander gehört :wink: Korrektur des Tutorials folgt...

_________________
Vergesst nicht: Es wird überall nur mit Wasser gekocht !!! ;-)
cwille
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

xp,win2003-server,linux
D7 Enterprise
BeitragVerfasst: Mo 02.05.05 13:33 
Titel: Re: Datenbank erstellen mit Zeos (6.1.5) Firebird und Delphi
Hallo ,

mit den FIBPlus Komponenten von DEVRACE www.devrace.com/, www.fibplus.com/
geht das wie nachfolgend gelistet.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TDataModule1.DBCreate(DBPfad: String);

Begin
 With FIBDatabase1 DO Begin
  DBParams.Clear;
  DBParams.Add('USER ''SYSDBA'' PASSWORD ''masterkey''');
  DBParams.Add('PAGE_SIZE = 2048');
  DBParams.Add('DEFAULT CHARACTER SET WIN1251');
  DBName:='d:\Firebird\FDB1.GDB'; // zum Bleistift
  SQLDialect:=3;
 End;
Try
 FIBDatabase1.CreateDatabase;
Except

End;
  FIBDatabase1.Open;
  FIBTransaction1.Active:= True;
End;




user profile iconnooby hat folgendes geschrieben:
Hallo,

ich such jetzt schon seit Stunden nach einer Lösung, aber ich komme irgendwie nicht weiter. Ich versuche mit Delphi und Zeos eine Firebird-Datenbank zu erstellen. Ich habe hierfür auch einige Hilfe gefunden, nur leider funktioniert davon nix richtig.

Hier mein Code Version 1:

ausblenden Delphi-Quelltext
1:
2:
3:
ZConnection1.Protocol := 'firebird-1.5';
ZConnection1.Properties.Add('CreateNewDatabase="D:\Daten\CD-Daten\Programmierungen\Zeos_Firebird_Test Test.gdb"');
ZConnection1.Connect;


und mein Versuch 2:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
ZConnection1.Database := 'D:\Daten\CD-Daten\Programmierungen\Zeos_Firebird_Test Test.gdb';// Path to Database
ZConnection1.HostName := 'localhost';
ZConnection1.Password := 'masterkey';
ZConnection1.User := 'SYSDBA';
ZConnection1.CreateDatabase;


wie gesagt, es funktionieren beide nicht. Was mache ich falsch??

Moderiert von user profile iconUGrohne: Delphi-Tags korrigiert.

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.