Board index » delphi » Client/server install or local install ????

Client/server install or local install ????

My app may work in 2 modes when accessing an IB Database:
client/server mode through a TCP/IP connection or on a local database.

As I know how to connect to a local database, if I know the path of it, the
easiest way to create only ONE version of the program running in both modes
is, I guess, to create an alias to a database, that I will set up
differently for the installations.

My question is: how can I create an alias with an installer or with Delphi
??? I will start my app differently with a command line to say if it's a
local install or remote install to create the alias.

Something else: after uninstalling my app, IbGuard is still running. It's
there any command line in order ot stop it before removing ???

Many thanks.

 

Re:Client/server install or local install ????


Quote
In article <3c57bbfa$1_2@dnews>, bedfo...@NOSPAMhotmail.com wrote...

Hi,

Quote
> My question is: how can I create an alias with an installer or with Delphi
> ??? I will start my app differently with a command line to say if it's a
> local install or remote install to create the alias.

As it was said in a previous post, IB does not have aliases.  So how you
set up you alias will depend on how you have decided to implement them
(either by a third-party solution or on one you developed you self)

Quote
> Something else: after uninstalling my app, IbGuard is still running. It's
> there any command line in order ot stop it before removing ???

You should never uninstall IB, as another application might be using it.

J

Re:Client/server install or local install ????


Well, I will turn my question differently:
I'm installing my app on a local computer. While installing, I want to allow
the user to select between local database (1 user) or server database (many
users). After that, if the user wants to use it locally, I install IB server
locally, otherwise, the IB will be installed on a server:
Now, My app must access a database. In my code, for now, I have, in the
databasename, the complete path of my DB. If once I want to access a
database on a server path, my app won't work anymore. So I must create
something that has always the same name and can point to different places:
that's what I call alias. Now, when you start IbConsole, you first register
a server. after that, you connect to the server (with a login/password).
After connecting, you register a database, selecting a file and then giving
it an alias (That the alias I'm talking about). My app should point to this
alias, so it doesn't matter if ther server is locally or remote, the app
should even never know that, it should only connect to a database,
somewhere....
So my question is: how can I connect to a database without the need to know
where is the database ???? without making the difference between local
server and remote server, without having to change any setting in my app
???? (I don't want to release a local and server configuration app....)

For the other question: their is a possibility to know if an other app is
using IB. (SharedDll's count I think). So, If I'm absolutely sure that their
is no other app using IB, how can I stop the IbGuard?

Thanks for your help...

Bob.

"J Hall" <j...@hall.com> a crit dans le message news:
MPG.16c1d831fda3cd4b989...@newsgroups.borland.com...

Quote
> In article <3c57bbfa$1_2@dnews>, bedfo...@NOSPAMhotmail.com wrote...

> Hi,

> > My question is: how can I create an alias with an installer or with
Delphi
> > ??? I will start my app differently with a command line to say if it's a
> > local install or remote install to create the alias.

> As it was said in a previous post, IB does not have aliases.  So how you
> set up you alias will depend on how you have decided to implement them
> (either by a third-party solution or on one you developed you self)

> > Something else: after uninstalling my app, IbGuard is still running.
It's
> > there any command line in order ot stop it before removing ???

> You should never uninstall IB, as another application might be using it.

> J

Re:Client/server install or local install ????


Quote
In article <3c57d176_1@dnews>, bedfo...@NOSPAMhotmail.com wrote...

Hi,

Quote
> So my question is: how can I connect to a database without the need to know
> where is the database ????

You can't, your app will always need to know the location of the
database.

Quote
> without making the difference between local
> server and remote server, without having to change any setting in my app
> ???? (I don't want to release a local and server configuration app....)

I would get you app to read this information from an INI file (created
by the install program)

For the local install..

[Database]
Server=LocalHost
Path=C:\MyApp\MyDatabase.gdb

For the remote install

[Database]
Server=MyServer
Path=C:\MyApp\MyDatabase.gdb

If you don't know the path of the database on install, you could use a
third party solution like Upscene Alias Resolver (www.upscene.com) or
IBam (www.orcka.com), or roll your own, but you will still need to know
the servername/IP

Quote
> For the other question: their is a possibility to know if an other app is
> using IB.

No. Most apps won't re-install IB if on exists, so no 'shared count'
will be updated.

Quote
> So, If I'm absolutely sure that their
> is no other app using IB, how can I stop the IbGuard?

I would recommend against it, but on Win9x you can 'FindWindow' and send
it a WM_QUIT message, on NT/2000 you will have to use the services
manager.

J

Re:Client/server install or local install ????


In article <MPG.16c1e5be8100e0f1989...@newsgroups.borland.com>,
j...@hall.com says...

Quote

> > For the other question: their is a possibility to know if an other app is
> > using IB.

> No. Most apps won't re-install IB if on exists, so no 'shared count'
> will be updated.

        J is correct.  In addition, IB server uses very little memory
(around 1 MB) when idle.  There is no reason to try and shut it down.

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Re:Client/server install or local install ????


Quote
> So my question is: how can I connect to a database without the need to know
> where is the database ???? without making the difference between local
> server and remote server, without having to change any setting in my app
> ???? (I don't want to release a local and server configuration app....)

  HELLO ,
I wonder if is possible To have in client application a variable where I
put the path of Database , (accessible while login) and reflects the dir
of  setup (as InstallShield).
Otherwise I can't share my PGMs.
Sorry for my language !!!
Giuseppe CaRAMANNO

Re:Client/server install or local install ????


Quote
"giuseppe Caramanno" <gcar...@tin.it> wrote in message

news:3C5848C4.3020601@tin.it...

Quote

>   HELLO ,
> I wonder if is possible To have in client application a variable
where I
> put the path of Database , (accessible while login) and reflects
the dir
> of  setup (as InstallShield).
> Otherwise I can't share my PGMs.
> Sorry for my language !!!
> Giuseppe CaRAMANNO

I use an INI file with my programs that contains the server name
and directory for the databases. Then, the program combines those
into a TCP connection string before connecting to the database.
The program options screen contains locations for modifying these
values in case they change in the future. That way, it's more
generic.

HTH
--
Woody (TMW)

----------------------
Can vegetarians eat animal crackers?
    George Carlin

Re:Client/server install or local install ????


I had a similar requirement, which I resolved by setting a value in my
INI file. You could create an INI file with 2 entries, eg

[DATABASE]
Local=c:\ib\mydb.gdb
Server=h:\ib\theirdb.gdb

and in (pseudo) code:

if MessageDlg('Use local database?', [mbYes,mbNo], ...) = mbYes then
        DBName := GetINIValue('LOCAL')
else
        DBName := GetINIValue('SERVER');  
with MyDMa.MyDatabase do
begin
  if (DatabaseName <> Value) then
  begin
    Connected := False;
    DatabaseName := DBName;
    Connected := True;
  end;
end;

HTH - how is your project going?

---
Sarah
[still fairly new to Delphi and OOP, but learning afap]

Re:Client/server install or local install ????


In article <3c59826f.117314...@newsgroups.borland.com>, "my.name"@adp-
es.co.uk (Sarah Mould) says...

Quote
> I had a similar requirement, which I resolved by setting a value in my
> INI file. You could create an INI file with 2 entries, eg

> [DATABASE]
> Local=c:\ib\mydb.gdb
> Server=h:\ib\theirdb.gdb

        Important: You can't use a share name or mapped drive for a remote
IB DB.  So the Server entry should look something like:

Server=my_server:c:\ib\theirdb.gdb

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Re:Client/server install or local install ????


Very good,
as newbie, I understand : .ini files.
But can I use a relative path (e.g ".\" for the current directory)?
Thanks
Giuseppe Caramanno
Quote
Craig Stuntz wrote:
> In article <3c59826f.117314...@newsgroups.borland.com>, "my.name"@adp-
> es.co.uk (Sarah Mould) says...

>>I had a similar requirement, which I resolved by setting a value in my
>>INI file. You could create an INI file with 2 entries, eg

>>[DATABASE]
>>Local=c:\ib\mydb.gdb
>>Server=h:\ib\theirdb.gdb

>    Important: You can't use a share name or mapped drive for a remote
> IB DB.  So the Server entry should look something like:

> Server=my_server:c:\ib\theirdb.gdb

>    -Craig

Re:Client/server install or local install ????


Quote
"Craig Stuntz" <cstuntz@no_spam.vertexsoftware.com> wrote in message

news:MPG.16c3852e7b3b7c5a9897f5@newsgroups.borland.com...

Quote
> In article <3c59826f.117314...@newsgroups.borland.com>, "my.name"@adp-
> es.co.uk (Sarah Mould) says...
> > I had a similar requirement, which I resolved by setting a value in my
> > INI file. You could create an INI file with 2 entries, eg

> > [DATABASE]
> > Local=c:\ib\mydb.gdb
> > Server=h:\ib\theirdb.gdb

> Important: You can't use a share name or mapped drive for a remote
> IB DB.  So the Server entry should look something like:

> Server=my_server:c:\ib\theirdb.gdb

I've found that I have to set the database field to
\\my_server\c:\ib\theirdb.gdb so is this different again!

Also, how do you best handle the situation when from one site to another the
database is on different drives ? For example, one client might have the DB
on drive C and another client might want it on drive D. So to avoid having
to recompile for each client is it best to just provide a different ini
file!

Jackie

Re:Client/server install or local install ????


Quote
Jackie wrote:

> I've found that I have to set the database field to
> \\my_server\c:\ib\theirdb.gdb so is this different again!

> Also, how do you best handle the situation when from one site to another the
> database is on different drives ? For example, one client might have the DB
> on drive C and another client might want it on drive D. So to avoid having
> to recompile for each client is it best to just provide a different ini
> file!

Yes it is.  That is what caused John Kaster and I to originally write
IBDatabaseINI a couple of years ago was because with CodeCentral I had the DB
one place, John another and the deployed version yet another.

Quote
> Jackie

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts, build
a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act
alone, solve equations, analyze a new problem, pitch manure, program a computer,
cook a tasty meal, fight efficiently, die gallantly.  Specialization is for
insects.   (RAH)

Re:Client/server install or local install ????


Thanks Jeff

Would very much appreciate some advice on how to use this IBDatabaseINI
component.

Is there any help or documentation available and if so where?

Are databasename and database properties automatically read from the
IBDatabaseINI component at runtime? Or is this where the Push/Pull stuff
comes in?

But then again how do you programatically push/pull values and write to ini
file?

Like most I'm sure, on my development PC I use a local Interbase database
but for the end user I intend to use a networked Interbase database but
don't see a Local/Remote property for the IBDatabaseINI component or is this
what the UseAppPath property is used for?

How do you set the UseAppPath, Username and Password properties in the ini
file?

Thanks
jackie
Melbourne, Australia
--------------------------------------------
Delphi Ent 5.0 (Build 6.18), IB6.0.1.6, IBX 5.02,
Windows 2000 (Build 2600).

"Jeff Overcash (TeamB)" <jeffoverc...@mindspring.com> wrote in message
news:3C5C39C1.1347DE7@mindspring.com...

Quote

> Jackie wrote:

> > I've found that I have to set the database field to
> > \\my_server\c:\ib\theirdb.gdb so is this different again!

> > Also, how do you best handle the situation when from one site to another
the
> > database is on different drives ? For example, one client might have the
DB
> > on drive C and another client might want it on drive D. So to avoid
having
> > to recompile for each client is it best to just provide a different ini
> > file!

> Yes it is.  That is what caused John Kaster and I to originally write
> IBDatabaseINI a couple of years ago was because with CodeCentral I had the
DB
> one place, John another and the deployed version yet another.

> > Jackie

> --
> Jeff Overcash (TeamB)
>       (Please do not email me directly unless  asked. Thank You)
> A human being should be able to change a diaper, plan an invasion, butcher
> a hog, conn a ship, design a building, write a sonnet, balance accounts,
build
> a wall, set a bone, comfort the dying, take orders, give orders,
cooperate, act
> alone, solve equations, analyze a new problem, pitch manure, program a
computer,
> cook a tasty meal, fight efficiently, die gallantly.  Specialization is
for
> insects.   (RAH)

Re:Client/server install or local install ????


Quote
Jackie wrote:

> Thanks Jeff

> Would very much appreciate some advice on how to use this IBDatabaseINI
> component.

> Is there any help or documentation available and if so where?

Yes, in the "IBXtras Documentation.doc" file included with the install.

Quote

> Are databasename and database properties automatically read from the
> IBDatabaseINI component at runtime? Or is this where the Push/Pull stuff
> comes in?

Read automatically.  You will want to set the IBDatabase's
AllowStreamedConnected to false.

Quote
> But then again how do you programatically push/pull values and write to ini
> file?

That is to setup an INI file at design time.

Quote
> Like most I'm sure, on my development PC I use a local Interbase database
> but for the end user I intend to use a networked Interbase database but
> don't see a Local/Remote property for the IBDatabaseINI component or is this
> what the UseAppPath property is used for?

> How do you set the UseAppPath, Username and Password properties in the ini
> file?

Select Write to INI from the component popup menu at design time after you have
set the values you want to be in the base INI file..

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts, build
a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act
alone, solve equations, analyze a new problem, pitch manure, program a computer,
cook a tasty meal, fight efficiently, die gallantly.  Specialization is for
insects.   (RAH)

Re:Client/server install or local install ????


In article <3C5A4261.1040...@tin.it>, gcar...@tin.it says...

Quote
> Very good,
> as newbie, I understand : .ini files.
> But can I use a relative path (e.g ".\" for the current directory)?

        I wouldn't recommend passing a relative path to IB, but there's
nothing wrong with your client storing a relative path (for a *local*
DB, of course) and expanding it before passing it to IB.

        HTH,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Go to page: [1] [2]

Other Threads