BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Newbie on IBO objects and SQL instead of Tables and BDE

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
KIB
Guest





PostPosted: Sat Apr 28, 2007 11:33 pm    Post subject: Newbie on IBO objects and SQL instead of Tables and BDE Reply with 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?

Thanks in advance.

:)
Kai Inge
Back to top
Aage Johansen
Guest





PostPosted: Sun Apr 29, 2007 1:08 am    Post subject: Re: Newbie on IBO objects and SQL instead of Tables and BDE Reply with quote



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





PostPosted: Sun May 06, 2007 6:08 pm    Post subject: Re: Newbie on IBO objects and SQL instead of Tables and BDE Reply with quote



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





PostPosted: Mon May 07, 2007 12:30 am    Post subject: Re: Newbie on IBO objects and SQL instead of Tables and BDE Reply with quote

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





PostPosted: Mon May 07, 2007 2:25 am    Post subject: Re: Newbie on IBO objects and SQL instead of Tables and BDE Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.