Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 19 total
Thread ServerProcedure
Wed, Dec 31 2008 2:41 AMPermanent Link

Phil Read
Hi Tim & Team,

I'm moving over some programs to BCB2009 using the lovely ElevateDB, I
used to use the following code in my server program using DBISAM to pass
back pieces of information to my client program. Now I understand this
is not the case with ElevateDB which now uses SQL to handle it.

Could you give me a basic idea (just a couple of the lines below will
do) of how I might achieve the same with ElevateDB?

Thanks very much...

void __fastcall TMainForm::ServerEngineServerProcedure(TObject *Sender,
      TDBISAMSession *ServerSession, const AnsiString ProcedureName)
{
  int LicenseCommand;

  if (AnsiCompareText(ProcedureName,"LicenseProcedure") == 0)
  {
    LicenseCommand =
ServerSession->RemoteParams->ParamByName("LicenseCommand")->AsInteger;
    ServerSession->RemoteParams->Clear();

    switch (LicenseCommand)
    {
      case 1 :

ServerSession->RemoteParams->CreateParam(ftString,"LicenseVendorID")->AsString
= LicenseVendorID;

ServerSession->RemoteParams->CreateParam(ftString,"LicenseOrganisation")->AsString
= LicenseOrganisation;


ServerSession->RemoteParams->CreateParam(ftString,"LicenseUserID")->AsString
= LicenseUserID;

ServerSession->RemoteParams->CreateParam(ftString,"LicenseCompany")->AsString
= LicenseCompany;


ServerSession->RemoteParams->CreateParam(ftString,"DBISAMVersion")->AsString
= ServerSession->EngineVersion;


ServerSession->RemoteParams->CreateParam(ftString,"LicenseRooms")->AsString
= LicenseRooms;

        if (LicenseRooms == 0)

ServerSession->RemoteParams->CreateParam(ftString,"LicenseValid")->AsBoolean
= false;
        else

ServerSession->RemoteParams->CreateParam(ftString,"LicenseValid")->AsBoolean
= true;
      break;
      case 2 :

ServerSession->RemoteParams->CreateParam(ftString,"IsdbsrvrFile")->AsBoolean
= FileExists(WPath + "dbsrvr.scf");
      break;
      case 3 :

ServerSession->RemoteParams->CreateParam(ftString,"PABXOK")->AsString =
PABXFunction();
      break;
      case 4 :
        AnsiString UserPassword, UserDescription;
        bool IsAdministrator;
        Word MaxConnections;

        ServerEngine->GetServerUser(ServerSession->CurrentRemoteUser,
UserPassword, UserDescription, IsAdministrator, MaxConnections);

ServerSession->RemoteParams->CreateParam(ftString,"UserDescription")->AsString
= UserDescription;
      break;
    }
  }
}
//---------------------------------------------------------------------------
Fri, Jan 2 2009 1:29 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Phil,

<< I'm moving over some programs to BCB2009 using the lovely ElevateDB, I
used to use the following code in my server program using DBISAM to pass
back pieces of information to my client program. Now I understand this is
not the case with ElevateDB which now uses SQL to handle it. >>

You can still use native Delphi/C++Builder code to implement procedures.
See the ElevateDB External Module template project in the Object Repository
in Delphi for more information on how to do this.  That template procedure
project won't work directly with C++Builder, but it will give you an idea of
how to create such a project that can be used to create an external module
that will work in a similar fashion as the server-side procedures in DBISAM.

After creating such a module (.dll), you simply copy it to the configuration
path for ElevateDB and then add the stored procedure like this:

CREATE PROCEDURE <Name>
([<ParamDefinition>[,ParamDefinition]])
EXTERNAL NAME <ModuleName>
[DESCRIPTION <Description>]

where ModuleName is the root name of the .dll that you copied to the
configuration path.

More information on external modules:

http://www.elevatesoft.com/manual?action=mantopic&id=edb2sql&category=0&topic=13

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Feb 28 2012 11:26 PMPermanent Link

IQA

Hi Guys,

I'm just wondering if this has changed in anyway over the ladt 4 years...

Is it now possible for an ElevateDB client program to send communcation to it's remote server program without having to produce an external module (.dll)... Seems like a big mission just to say to the remote server "hey, run this function".

All I'm trying to do is have the client program send a signal to trigger the server program to run some code.

Thanks,

Phil.
Wed, Feb 29 2012 2:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Phil,

<< I'm just wondering if this has changed in anyway over the ladt 4 years...
>>

No, nothing yet - still requires an external module.  I'm going to be doing
some playing around in there this week, though, so I'll see what I can do.

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, Feb 29 2012 4:43 PMPermanent Link

IQA

<< No, nothing yet - still requires an external module.  I'm going to be doing
some playing around in there this week, though, so I'll see what I can do.
>>

Tim, You could reach legendary status if you came up with a solution. Just an iddy biddy event or something to allow the client to send through a message.

No pressure, but thanks just for considering it.

Phil.
Tue, Mar 6 2012 8:48 PMPermanent Link

IQA

<< No, nothing yet - still requires an external module.  I'm going to be doing
some playing around in there this week, though, so I'll see what I can do.
>>

Hi Tim,

I just wanted to touch base to see what conclusion you came to when playing around in there last week.

Is the ServerProcedure something that will be implemented any time soon do you think? I ask because I'm at a stage in my project where I need to decide if I'm going to get lost in a learning curve producing an external module OR can hang on for a near update which will give us a way to send a signal from the client to the server so it can run some code from the server side on command.

Cheers,

Phil.
Wed, Mar 21 2012 3:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Philip,

<< I just wanted to touch base to see what conclusion you came to when
playing around in there last week. >>

It's doable, definitely.

<< Is the ServerProcedure something that will be implemented any time soon
do you think? >>

I can't make any promises, but I will see what I can do.  I've got a stack
of enhancements that I've got scheduled for the next minor release, and this
is in there also.

--
Tim Young
Elevate Software
www.elevatesoft.com
Tue, Apr 10 2012 1:59 AMPermanent Link

IQA

Thanks Tim. &#1641;(-&#814;&#814;&#771;-&#771Wink#1782;
Thu, Apr 19 2012 1:44 AMPermanent Link

IQA

Hi Tim,

I know your a busy man over there and lots going on... I'm at a fork in the road on a project and it's not quite at testing stage yet, but will be in the 4 weeks.

I'm wondering if I should be looking at an alternative way to get a message layer happening between a client / server or should I just hold in there for the Messaging layer for general messaging notifications and broadcasts with the ElevateDB server?

If not I'll have to look into using Indy (ahhhh).

I wont hold you too it and I'm an optimist, so hoping we might have something in the next release Smile

Cheers,

Phil.
Thu, Apr 19 2012 4:03 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Philip


If you have to do it yourself look at Synapse rather than Indy.

Roy Lambert
Page 1 of 2Next Page »
Jump to Page:  1 2
Image