Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Many Databases using one session.
Wed, Jul 4 2012 1:37 PMPermanent Link

Abdulaziz Al-Jasser

Hi,

I'm pretty sure that this issue was raised before.  However, I couldn't find the complete answer.  The case is this:

I have many database located in remote server on different directories.  I want the user to list all databases using one session and to be able to choose one to work with.  I've tried to create a second database using "CREATE DATABAS" on that remote server using the same session, but wasn't able to retrieve the name of this database using TEDBSession (EDBSession1.GetDatabaseNames) on the client machine.  I searched the forum and found one thread were Tim was telling that he will write some articles about that.  Can you point me to right direction?

Best Regards,
Abdulaziz Jasser
Wed, Jul 4 2012 1:48 PMPermanent Link

Raul

Team Elevate Team Elevate

While i have not used this i believe you need to use "GetDatabases" function

see help :
http://www.elevatesoft.com/manual?action=viewmethod&id=edb2&product=rsdelphiwin32&version=XE2&comp=TEDBSession&method=GetDatabases



GetDatabaseNames gives you list of tedatabase objects connected to your
session in your application and has nothign to do with actual databases
that exist in the configuration file.

Raul




On 7/4/2012 1:37 PM, Abdulaziz Jasser wrote:
> Hi,
>
> I'm pretty sure that this issue was raised before.  However, I couldn't find the complete answer.  The case is this:
>
> I have many database located in remote server on different directories.  I want the user to list all databases using one session and to be able to choose one to work with.  I've tried to create a second database using "CREATE DATABAS" on that remote server using the same session, but wasn't able to retrieve the name of this database using TEDBSession (EDBSession1.GetDatabaseNames) on the client machine.  I searched the forum and found one thread were Tim was telling that he will write some articles about that.  Can you point me to right direction?
>
> Best Regards,
> Abdulaziz Jasser
>


Wed, Jul 4 2012 4:34 PMPermanent Link

Abdulaziz Al-Jasser

Raul

Just notice bellow two different ways give two different results:


//Firts way.
EDBSession1.GetDatabaseNames(cboDB.Items);



//Second way.
qryDB := TEDBQuery.Create(Application);

EDBSession1.Execute('SELECT * FROM DATABASES',Nil,qryDB);
Wed, Jul 4 2012 5:09 PMPermanent Link

Raul

Team Elevate Team Elevate

You are calling the WRONG function. see my previous email.

you need to do

EDBSession1.GetDatabases(cboDB.Items)

and you should see same results as with SELECT * FROM DATABASES.

Raul


On 7/4/2012 4:34 PM, Abdulaziz Jasser wrote:
> Raul
>
> Just notice bellow two different ways give two different results:
>
>
> //Firts way.
> EDBSession1.GetDatabaseNames(cboDB.Items);
>
>
>
> //Second way.
> qryDB := TEDBQuery.Create(Application);
>
> EDBSession1.Execute('SELECT * FROM DATABASES',Nil,qryDB);
>


Mon, Jul 9 2012 1:01 PMPermanent Link

Abdulaziz Al-Jasser

Raul

Thanks for the help....
Regards,
Abdulaziz Jasser
Image