This is a very easy and simple
1.Drop TIBConnection component from SQLdb page in a form or data module.
2.Drop a button, and write this code in button’s OnClick event:
procedure TForm1.Button1Click(Sender: TObject);
begin
IBConnection1.DatabaseName:= '/home/motaz/firebird/newdb.fdb';
IBConnection1.CharSet:= 'UTF8';
IBConnection1.UserName:= 'sysdba';
IBConnection1.Password:= 'masterkey';
IBConnection1.CreateDB;
end;
This will create an empty FireBird database in the location you have specified in DatabaseName property, with UTF8 character set.
3.Later you can create tables, generators, indexes, and constraints using SQLQuery component example:
create table BOOKS (
BOOKID INTEGER not null ,
BOOKNAME VARCHAR(52) ,
CONTENTS BLOB,
LOCATION VARCHAR(55)
, constraint PK_BOOKS_1 primary key (BOOKID)
);
This will create a new table called Books. You need to put this DDL script in SQL property of SQLQuery component that linked to your IBConnection.
1.Drop TIBConnection component from SQLdb page in a form or data module.
2.Drop a button, and write this code in button’s OnClick event:
procedure TForm1.Button1Click(Sender: TObject);
begin
IBConnection1.DatabaseName:= '/home/motaz/firebird/newdb.fdb';
IBConnection1.CharSet:= 'UTF8';
IBConnection1.UserName:= 'sysdba';
IBConnection1.Password:= 'masterkey';
IBConnection1.CreateDB;
end;
This will create an empty FireBird database in the location you have specified in DatabaseName property, with UTF8 character set.
3.Later you can create tables, generators, indexes, and constraints using SQLQuery component example:
create table BOOKS (
BOOKID INTEGER not null ,
BOOKNAME VARCHAR(52) ,
CONTENTS BLOB,
LOCATION VARCHAR(55)
, constraint PK_BOOKS_1 primary key (BOOKID)
);
This will create a new table called Books. You need to put this DDL script in SQL property of SQLQuery component that linked to your IBConnection.
Any1 know how i do these configs in component IBConnetion:
ReplyDeleteUserName: SYSDBA
Password: masterkey
DatabaseName: //local/bd.fdb
HostName: localhost
Conected: True
How do i use these configs in network with 2 PCs? I am trying but i cant connect to Windows either. Please Mail me to. gfsfbrspvga332@gmail.com. Thanks a lot.