Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 13 total
Thread Creating DB in Server
Sat, Dec 6 2008 1:58 PMPermanent Link

Dale Derix
I'm new to ElevateDB (and C/S) and am still a bit wobbly.

I'm creating a C/S app and from other posts I've gathered that the preferred way to deploy
my database is to have the server create it at first run.  So, using the CD Collector as a
guide, I'm preparing to do this, but I'm still a little fuzzy on the best way to do this.

If anyone else has already done this, I would appreciate any tips.  (be sure to speak
slowly.... I'm new at this).

Thanks,

Dale
Sun, Dec 7 2008 12:25 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Dale,

Your application can, at startup, test for the existence of a database
and create it if doesn't exist, and that's valid for both file-sharing
and client/server mode. The main difference is that you must always have
in mind that when you are using C/S all operation are executed by/on the
server, so all file and directory references are relative to the server.
You can test for the existence of a database querying the "databases"
table in the "Configuration" database:

  SELECT * FROM Configuration.Databases WHERE Name = <YourDBName>

Also, when you create a database in C/S mode

  CREATE DATABASE <YourDBName> PATH <DBPath>

it's important to remember that <DBPath> is relative to the server, not
on the computer executing the application.


--
Fernando Dias
[Team Elevate]
Mon, Dec 8 2008 9:31 AMPermanent Link

Dale Derix
Thank you Fernando:

I'll give it a try today.

Dale
Mon, Dec 8 2008 4:19 PMPermanent Link

Dale Derix
Fernando,

One more question.....

When I create the session to use to create the database and tables, should it still be
Remote, even though I'm creating the tables locally, on the same machine as that the
server is running from?

Dale
Mon, Dec 8 2008 5:43 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Dale,

> When I create the session to use to create the database and tables, should it still be
> Remote, even though I'm creating the tables locally, on the same machine as that the
> server is running from?

In the specific case where EDB Server is in the same computer where the
client application is, both will work but if you really want to develop
for C/S it should be stRemote so that it can work everywhere.

Also keep in mind that when you use remote sessions you are creating the
database definitions in the configuration file on the server, not the
local configuration file (though in this particular case it can be the
same configuration file).

--
Fernando Dias
[Team Elevate]
Mon, Dec 8 2008 8:06 PMPermanent Link

Dale Derix
Hi Fernando:

>>In the specific case where EDB Server is in the same computer where the
>>client application is, both will work but if you really want to develop
>>for C/S it should be stRemote so that it can work everywhere.

In this case, I'm only talking about when the server starts up for the first time (for
instance, after a fresh installation), then I want it to go ahead and create an empty
database (and tables) on the server.  ALL client applications on the other hand will be
running C/S, including the one on the server.

I'm just looking for the "easiest" way to get the database files created by the server.
All of my previous experience is with f/s configurations, so hopefully this c/s stuff will
click pretty soon.

Thanks,

Dale
Mon, Dec 8 2008 9:15 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Dale,

The only way I know to make EDB server to automatically start the
execution of a script by himself is to create a JOB and schedule it to
run on a certain date/time, but I don't think that is a good solution to
first create databases. So, it seems to me that your idea of the server
creating the databases automatically on the first run is not very
practical.

I'm using two methods to create databases on the server:

1st :
Whenever the client application starts, the first thing it does after
connecting to the server is to verify if the database exists on the
server and creates it (on the server, of course) if it doesn't. That's
it. Simple and effective.

2nd:
In this case the database is created along with the server installation.
It's the "Setup" program that installs the server that will also create
the database. The database is created by a sequence of SQL statements
executed called from a "CreateDatabase" procedure, in a DLL "embeded"
inside the setup program. The setup is created using InnoSetup.

Until now, the second method has been working very well, but it has some
complexity and I use it only because one of my applications requires
that one of the databases it uses be present when it first starts. All
other databases are created using the first method.

--
Fernando Dias
[Team Elevate]
Mon, Dec 8 2008 9:24 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Dale,

Finally, the really easy option Smiley:
The simplest method is to distribute the configuration file and database
catalogs along with EDB Server, but this only works if you know in
advance exactly what databases you need to create and where.
I always forget about this option because I never used it - I have a
tendency to complicate things Smiley

--
Fernando Dias
[Team Elevate]
Tue, Dec 9 2008 11:18 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Dale,

<< I'm just looking for the "easiest" way to get the database files created
by the server. All of my previous experience is with f/s configurations, so
hopefully this c/s stuff will click pretty soon. >>

In addition to the fine suggestions by Fernando, another option is to copy
the edbsrvr.dpr project source code to your own folder/directory, and then
modify the server project source code so that it includes all of the desired
database creation code during startup.  The server project source code
rarely, if ever, changes, so it is fairly safe to modify it and re-brand it
for your own purposes.  All of the actual server source code is located in
the edbserver.pas unit, so any changes to the server occur there, not in the
edbsrvr.dpr project.  The edbsrvr.dpr project is just a wrapper around the
TEDBEngine component (EngineType=etServer) and also includes the
functionality to run the server as a service.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Dec 29 2008 12:50 PMPermanent Link

Bill Root
<< The simplest method is to distribute the configuration file and database
catalogs along with EDB Server, but this only works if you know in
advance exactly what databases you need to create and where. >>

Please excuse me for jumping in.  I'm also new to elevateDB, having used DBISAM for many
years.

It sounds like it's not possible to widely distribute an existing database with a product
using elevateDB, since one can't really know where it will be stored.  So what do people
who need to distribute an existing database (i.e., with something in it) do?  Convert the
data to a different format and then import it during installation?  Coming from DBISAM,
where I could distribute the table files, already created and populated, this seems like a
major loss of functionality.  What am I missing?

Thanks,
Bill
Page 1 of 2Next Page »
Jump to Page:  1 2
Image