 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
KIB Guest
|
Posted: Sat Apr 28, 2007 11:33 pm Post subject: Newbie on IBO objects and SQL instead of Tables and BDE |
|
|
Hello.
I'm a bit frustrated over migrating from BDE and dBase to IBObjects
and Firebird. Also I'm migrating from Delphi 3 to Delphi 2005
Architect at the same time.
I need advise about how to get the first connection in a project with
Firebird Example database Employee.fdb.
I've downloaded a trial of IBObjects. I need advice on how to use the
components and which properties to be filled to get connection. I have
a Database component, a Query component, a DataSource and a Grid
component (In that order) on my very first form, using Delphi 2005
Architect.
I guess that the grid uses the datasource that uses the Query that
uses the database component?
If so, how do I fill the properties in the components so fx
FULL_NAME, JOB_CODE fields in Employee table and
JOB_TITLE field in JOB table in Employee.fdb shows up in the grid?
Thanks in advance.
:)
Kai Inge |
|
| Back to top |
|
 |
Aage Johansen Guest
|
Posted: Sun Apr 29, 2007 1:08 am Post subject: Re: Newbie on IBO objects and SQL instead of Tables and BDE |
|
|
KIB wrote:
| Quote: | Hello.
I'm a bit frustrated over migrating from BDE and dBase to IBObjects
and Firebird. Also I'm migrating from Delphi 3 to Delphi 2005
Architect at the same time.
I need advise about how to get the first connection in a project with
Firebird Example database Employee.fdb.
I've downloaded a trial of IBObjects. I need advice on how to use the
components and which properties to be filled to get connection. I have
a Database component, a Query component, a DataSource and a Grid
component (In that order) on my very first form, using Delphi 2005
Architect.
I guess that the grid uses the datasource that uses the Query that
uses the database component?
If so, how do I fill the properties in the components so fx
FULL_NAME, JOB_CODE fields in Employee table and
JOB_TITLE field in JOB table in Employee.fdb shows up in the grid?
|
A Database component may be the easiest way to convert from BDE to IBO,
but it would be better to use a connection component and a transaction
component.
There is an IBO newsgroup (mirrored on news.atkins.com) - see also:
http://www.ibphoenix.com/main.nfs?a=ibphoenix&s=1177773057:975427&page=ibp_groups
- look for "The IBObjects List".
There is also an inexpensive "Getting started guide" at the IBO site.
Now, starting with a form with connection (TIB_Connection), transaction
(TIB_Transaction), query (TIB_Query), datasource (TIB_DataSource) and
grid (TIB_Grid) components (let's call them cnEMP, txEMP, qrEMP, dsEMP
and grEMP, resp.):
For cnEMP: set server (e.g. localhost), Protocol (choose cpTCP_IP), Path
(wherever the database is, or (better) use an alias), username(e.g.
SYSDBA) and Loginprompt=true. You can check the DatabaseName property
and see that it contains the full server:path to the database.
For txEMP: set IB_Connection = cnEMP.
For qrEMP: set IB_Connection=cnEMP and IB_Transaction=txEMP. Set the
SQL property to (you can also double-click on the component):
--------------
select E.FULL_NAME, E.JOB_CODE, J.JOB_TITLE
from EMPLOYEE E join JOB J
on E.JOB_CODE = J.JOB_CODE
and E.JOB_GRADE = J.JOB_GRADE
and E.JOB_COUNTRY = J.JOB_COUNTRY
--------------
for dsEMP: set Dataset = qrEMP
for grEMP: set DataSource = dsEMP
This is all untested and I may have forgotten something and gotten
something wrong, but I hope you see how the components are connected.
Welcome to Fb and IBO.
--
Aage J. |
|
| Back to top |
|
 |
KIB Guest
|
Posted: Sun May 06, 2007 6:08 pm Post subject: Re: Newbie on IBO objects and SQL instead of Tables and BDE |
|
|
On 28 Apr, 22:08, Aage Johansen <aagjo...@offline.no> wrote:
| Quote: | KIB wrote:
Hello.
I'm a bit frustrated over migrating from BDE and dBase to IBObjects
and Firebird. Also I'm migrating from Delphi 3 to Delphi 2005
Architect at the same time.
I need advise about how to get the first connection in a project with
Firebird Example database Employee.fdb.
I've downloaded a trial of IBObjects. I need advice on how to use the
components and which properties to be filled to get connection. I have
a Database component, a Query component, a DataSource and a Grid
component (In that order) on my very first form, using Delphi 2005
Architect.
I guess that the grid uses the datasource that uses the Query that
uses the database component?
If so, how do I fill the properties in the components so fx
FULL_NAME, JOB_CODE fields in Employee table and
JOB_TITLE field in JOB table in Employee.fdb shows up in the grid?
A Database component may be the easiest way to convert from BDE to IBO,
but it would be better to use a connection component and a transaction
component.
There is an IBO newsgroup (mirrored on news.atkins.com) - see also:http://www.ibphoenix.com/main.nfs?a=ibphoenix&s=1177773057:975427&pag...
- look for "The IBObjects List".
There is also an inexpensive "Getting started guide" at the IBO site.
Now, starting with a form with connection (TIB_Connection), transaction
(TIB_Transaction), query (TIB_Query), datasource (TIB_DataSource) and
grid (TIB_Grid) components (let's call them cnEMP, txEMP, qrEMP, dsEMP
and grEMP, resp.):
For cnEMP: set server (e.g. localhost), Protocol (choose cpTCP_IP), Path
(wherever the database is, or (better) use an alias), username(e.g.
SYSDBA) and Loginprompt=true. You can check the DatabaseName property
and see that it contains the full server:path to the database.
For txEMP: set IB_Connection = cnEMP.
For qrEMP: set IB_Connection=cnEMP and IB_Transaction=txEMP. Set the
SQL property to (you can also double-click on the component):
--------------
select E.FULL_NAME, E.JOB_CODE, J.JOB_TITLE
from EMPLOYEE E join JOB J
on E.JOB_CODE = J.JOB_CODE
and E.JOB_GRADE = J.JOB_GRADE
and E.JOB_COUNTRY = J.JOB_COUNTRY
--------------
for dsEMP: set Dataset = qrEMP
for grEMP: set DataSource = dsEMP
This is all untested and I may have forgotten something and gotten
something wrong, but I hope you see how the components are connected.
Welcome to Fb and IBO.
--
Aage J.- Skjul sitert tekst -
- Vis sitert tekst -
|
Hello again
and thank you for the answer. I have tried your code and after some
experimental activities the data showed up in the iboGrid in
designtime.
When I run the program, however, the grid is empty.
When I stop the program and Delphi 2005 Architect returns to design
mode the data shows up again in the grid.
I do not kwow why, and what I can do to see the data in running mode.
Any ideas?
:)
Kai Inge |
|
| Back to top |
|
 |
Aage Johansen Guest
|
Posted: Mon May 07, 2007 12:30 am Post subject: Re: Newbie on IBO objects and SQL instead of Tables and BDE |
|
|
KIB wrote:
| Quote: | ...
Hello again
and thank you for the answer. I have tried your code and after some
experimental activities the data showed up in the iboGrid in
designtime.
When I run the program, however, the grid is empty.
When I stop the program and Delphi 2005 Architect returns to design
mode the data shows up again in the grid.
I do not kwow why, and what I can do to see the data in running mode.
Any ideas?
|
Do you (explicitly) open the query at runtime?
cnEMP.Connected:=true;
qrEMP.Open;
Otherwise, ask in the IBO newsgroup.
--
Aage J. |
|
| Back to top |
|
 |
KIB Guest
|
Posted: Mon May 07, 2007 2:25 am Post subject: Re: Newbie on IBO objects and SQL instead of Tables and BDE |
|
|
On 6 Mai, 21:30, Aage Johansen <aagjo...@offline.no> wrote:
| Quote: | KIB wrote:
...
Hello again
and thank you for the answer. I have tried your code and after some
experimental activities the data showed up in the iboGrid in
designtime.
When I run the program, however, the grid is empty.
When I stop the program and Delphi 2005 Architect returns to design
mode the data shows up again in the grid.
I do not kwow why, and what I can do to see the data in running mode.
Any ideas?
Do you (explicitly) open the query at runtime?
cnEMP.Connected:=true;
qrEMP.Open;
Otherwise, ask in the IBO newsgroup.
--
Aage J.
|
Thank you. That was the detail needed. I believed the designtime
settings was still valid at runtime.
They used to with Delphi 3 and dBase as far as I remember.
Thanks again.
:)
Kai Inge |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|