Subject Re: [IBO] Getting Started Guide.
Author Helen Borrie
At 12:52 PM 10-09-01 +1000, you wrote:
> >The Getting Started Guide
>
>I can't find this anywhere - in either of the two .hlp files - or anywhere else. Please advise where I might find it?


http://www.ibobjects.com/ibo_gsg.html for details. The link is there for purchasing the subscription.


>Meanwhile I have managed to get a Project together - during which time the TIB_Grid, TIB_UpDateBar and TIB_Text inputs all faithfully reflected the presence of the TIB_DataSource and TIB_Query which I had dropped onto a DataModule (which I had duly included in the "Uses" clause of the Form) together with a TIB_Connection (named "Connect") and a TIB_Transaction (named "Transaction") .
>
>1.TIB_Connection has the following Properties
>1.1AliasName is set to "IBLocal".

Don't use this unless you already have a BDE Alias set up by this name and you would like to have the connection details picked up from an idapi32.cfg file.

>1.2DataBaseName is set to the path to my DataBase.

That will happen automatically when you initially set up the server, protocol and path properties. It is a good idea to give this a "friendly" name. That will become a kind of alias in your application to represent the actual connection string, whatever that might be on the system where the app is installed.

>1.3Path is also set to the path to my DataBase.

It needs to be a physical path (not mapped, not UNC notation), e.g.

c:\databases\myDB.gdb


>2. TIB_Transaction has "IB_Connection" set to "Connect".

It might not be such a great idea to name objects with names of other members, i.e. Connect is also the name of a (rather essential) method. Change it to sthg else, e.g. "Connection"


>When I run it everything compiles - but it is obvious that I don't have access to anything. Even the TIB_Grid does not show the fields.
>
>Perhaps someone can please tell me what I am missing.

Assuming all the pieces are properly connected to one another, you will need to do the following:

1. in the DPR file, move the Create call for the datamodule up above that for the form.

2. If you want the datasets to be open when you start the application, you will need to open them in the FormCreate of the datamodule, e.g.
...
var
ii: integer;
with myDatamodule do
begin
if not Connection.connected then
Connection.Connect;
// connect ib_queries
for ii := 0 to ComponentCount - 1 do
begin
if Components[ii] is TIB_BDataset then
with Components[ii] as TIB_BDataset do
Components[ii].Open
else if Components[ii] is TIB_Cursor do
Components[ii].First;
end;
...
end;

This btw is just a generic way to go about it - if you have parameterised statements, datasets you don't want to open at FormCreate, etc., you will have to address each dataset more specifically.

Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________