Create DATABASE on Selected Server

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
vandir
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 18.01.2006, 05:55
Location: Brazil

Create DATABASE on Selected Server

Post 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.
gto
Zeos Dev Team
Zeos Dev Team
Posts: 278
Joined: 11.11.2005, 18:35
Location: Porto Alegre / Brasil

Post 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!
Use the FU!!!!!IN Google !

gto's Zeos Quick Start Guide

Te Amo Taís!
barko
Senior Boarder
Senior Boarder
Posts: 51
Joined: 07.09.2005, 13:13

Post 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;
Post Reply