Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread Use ElevateDB in server mode
Tue, Jan 20 2009 6:05 AMPermanent Link

Bruno
Hi,

I'm trying to use ElevateDB in server mode and it's doesn't work. This is what I want to do

I have one server with my Data, the IP of my server is 192.168.250.15 and the edbsrvr is start

I have another computer that has the application and would like access to data which are on the server.

In my application, is it necessary to use a component TEDBEngine and a component TEDBSession ?

How do I configure them to use the data on my server ?

Thanks a lot for your answer
Tue, Jan 20 2009 11:15 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Bruno,

<< In my application, is it necessary to use a component TEDBEngine and
a component TEDBSession ?>>

No, not necessarily but if you don't put a TEDBEngine component on your
application, then a TEDBEngine object will be automatically created.
The same for TEDBSession: if you don't put at least one session
component in your application, then an instance of a TEDBSession will be
automatically created and used. Those automatically created objects can
be accessed in runtime through the global "Engine" and "Session"
variables. If you use this method you must set all the property values
using code, at runtime. For example:

  Session.SessionType:=stRemote;
  Session.LoginUser:='Administrator';
  Session.LoginPassword:='EDBDefault';
  Session.RemoteAddress:='192.168.250.15';
  Session.Open;



--
Fernando Dias
[Team Elevate]
Tue, Jan 20 2009 11:41 AMPermanent Link

bruno
Thank you for your answer, but I managed to find after you have written lol

I have other questions:

1 - If I put my session with the parameter stRemote, the component TEDBengine remains on etClient ?

2 - When I use remote session on many computers with the same database on my server, the configuration file is saved on all the users or is it
saved on the server and used by all client computers ?

3 - I connect to a server, and I was starting my database of the following ways :
EDBSession1.Execute('CREATE DATABASE "DBTEST" PATH ''\\192.168.250.15\f\TEST BD\ELEVATEDB\TABLE''');

The database is properly created, but when I make a query on a table, I receive an error message :
"ElevateDB Error #700 An error was found in the statement at line 1 and column 15 (ElevateDB Error #401 The table or view Materiaux does not
exist)" What's happened ? All my table are on my server in the directory define by my Database.

This is how I make my Query :

   EDBQuery2.DatabaseName := 'DBTEST';
   EDBQuery2.SQL.Text := 'SELECT * FROM Materiaux';
   EDBQuery2.Open;

Thanks for your help

Greetings,

Bruno
Tue, Jan 20 2009 1:08 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Bruno,

<<1 - If I put my session with the parameter stRemote, the component
TEDBengine remains on etClient ?>>

Yes. They are completely different things: stRemote is the type of
connection for the session and has nothing to do with etClient, that
indicates that the Engine object is acting as a client engine and not as
a database server engine.

<< 2 - When I use remote session on many computers with the same
database on my server, the configuration file is saved on all the users
or is it
saved on the server and used by all client computers ?>>

Remote sessions don't directly use any configuration file - they use the
configuration file the server is using, and it should be located in the
same computer where the EDB server is.

<< 3 - I connect to a server, and I was starting my database of the
following ways :
EDBSession1.Execute('CREATE DATABASE "DBTEST" PATH
''\\192.168.250.15\f\TEST BD\ELEVATEDB\TABLE''');>>

If you are creating the database using a remote session, then the PATH
is relative to the server. For example:
CREATE DATABASE "DBTEST" PATH 'F:\TEST BD\ELEVATEDB\TABLE'
will create the database in drive f: of the server. You may also use unc
paths, but they must specify a directory that is accessible from the
server and I suspect the path you are specifying is not a valid unc path.

--
Fernando Dias
[Team Elevate]
Wed, Jan 21 2009 12:50 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Bruno


You seem to be having a bit of difficulty with the TEDBEngine & TEDBSession components - where and when to use them. Fernando's explanation is good, and to reinforce both his post and my earlier post I would like to add the following.

If any app you develop is to use ElevateDB it MUST have an engine, a session and a database in addition to any tables or queries you use. If you don't drop them on a form or datamodule they'll be created in the background. As Fernando and I both mention its a lot easier to fill in the properties if you have them on a form or datamodule. NOTE you can only have ONE engine per app and all session names must be unique.

If you use threads at all then for isolation purposes you must have separate session and database and table/query components for each thread. For this purpose I wrote a small function copying the properties from the "main" session.

Roy Lambert [Team Elevate]
Wed, Jan 21 2009 4:11 AMPermanent Link

Bruno
Ok,

As you indicate, I create my Database with a relative path that is 'F:\TEST BD\ELEVATEDB\TABLE'

This path indicates the directory where the tables are stored on the server but when I open my query, I get the error message indicating that the
table does not exist.

To check if my Database is correct, I use the Elevate DB Manager with the same configuration settings and my tables are not visible.

What's happened ?

Fernando Dias wrote:

Bruno,

<<1 - If I put my session with the parameter stRemote, the component
TEDBengine remains on etClient ?>>

Yes. They are completely different things: stRemote is the type of
connection for the session and has nothing to do with etClient, that
indicates that the Engine object is acting as a client engine and not as
a database server engine.

<< 2 - When I use remote session on many computers with the same
database on my server, the configuration file is saved on all the users
or is it
saved on the server and used by all client computers ?>>

Remote sessions don't directly use any configuration file - they use the
configuration file the server is using, and it should be located in the
same computer where the EDB server is.

<< 3 - I connect to a server, and I was starting my database of the
following ways :
EDBSession1.Execute('CREATE DATABASE "DBTEST" PATH
''\\192.168.250.15\f\TEST BD\ELEVATEDB\TABLE''');>>

If you are creating the database using a remote session, then the PATH
is relative to the server. For example:
CREATE DATABASE "DBTEST" PATH 'F:\TEST BD\ELEVATEDB\TABLE'
will create the database in drive f: of the server. You may also use unc
paths, but they must specify a directory that is accessible from the
server and I suspect the path you are specifying is not a valid unc path.

--
Fernando Dias
[Team Elevate]
Wed, Jan 21 2009 5:38 AMPermanent Link

Bruno
I have found my problem, it's because I have delete the file "EDBDatabase.EDBCat" in the directory

How can I rebuild this file for seeing my table ?
Wed, Jan 21 2009 6:01 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Bruno,

> How can I rebuild this file for seeing my table ?
The file you deleted is the "core" of your database - it contained all the
metadata for that database (table structures, index definitions, stored
procedure code, RI constraint definitions, etc..)
I'm not aware of any magic pass to recreate the file Smiley
The only 2 ways I can think of are restoring the deleted file from an
existing backup or recreate your tables again using SQL.

You must have in mind that with EDB you can't "play around" with the files
in the database directory. If you want to move the database to another
location then you must copy all files in the directory. If you want to
remove a table or another database object from the database, you must do it
using SQL from your own code or EDBManager.

--
Fernando Dias
[Team Elevate]


Wed, Jan 21 2009 6:29 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Bruno

>I have found my problem, it's because I have delete the file "EDBDatabase.EDBCat" in the directory
>
>How can I rebuild this file for seeing my table ?

There is nothing in ElevateDB that will enable you to rebuild the catalog. Unlike DBISAM all the table structure information is stored in the catalog not the tables.

If you don't have a backup all you can do is create another catalog and enter the appropriate table structure info into it.

There is one possibility if you created the tables via migration which is to migrate the database again to a different directory and copy the catalog (ie EDBDatabase.EDBCat) from there. Even that might not work if there are version changes in the tables.

Roy Lambert [Team Elevate]
Image