Page 1 of 1

Create DATABASE on Selected Server

Posted: 18.01.2006, 06:17
by vandir
I using ZEOS 6.5.1 with C++Builder 6, and work fine, but I need the information if is possible create a DATABASE ON SERVER SELECTED, but the ZConnection component only work if I selected the DATABASE found on my server.



Thank.

Posted: 18.01.2006, 13:25
by gto
Hello!
I think that isn't possible to create directly from Zeos, I've searched a little and can't find anything =/
By the way, if you are using delphi, you may look at the "Interbase" palette (delphi 7 here), there is the IBDatabase component which have the CreateDatabase property... a thing to explore out!
[]'s

-------------------------

É bom conversar com algum compatriota vez em quando! me parece que esse componente IBDatabase resolve o problema, mas de repente a galera do fórum conhece aguma outra manha :)
Valeu cara!

Posted: 19.02.2006, 20:58
by barko
This is the way:

Code: Select all

procedure TMainForm.FormCreate(Sender: TObject);
begin
  db.Database:='~/kejpaje.gdb';
  db.User:='sysdba';
  db.Password:='masterkey';
  if not FileExists(db.database) then
  begin
    db.Properties.Add('createnewdatabase=create database '''+db.Database+''' user ''sysdba'' password ''masterkey'' page_size 4096 default character set iso8859_2;');
    try
      db.Connect;
    except
      application.Terminate;halt;
    end;
  end else
  begin
    try
      db.connect;
    except
      application.Terminate;halt;
    end;
  end;
  ...
end;