🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.multi-tier
3 messages
3 total messages Started by Will Hunt Tue, 20 Feb 2001 05:51
how to transfer the SQL command from client to Application Server?
#710
Author: Will Hunt
Date: Tue, 20 Feb 2001 05:51
10 lines
1381 bytes
I want to let the client to dynamically generate the SQL command. I know in
the c/s
environment ,it's not difficult to realize it.But,now i adapted the midas
mode ,and the system has been used for some time. I want to how to resolve
it .I've seen some books,takling about BCB3.0 or4.0 , have introduce to
resolve it through TProvider,but in BCB5 this component has seems to
disappeared.
Can anyone help me! THX

                                Willy
Re: how to transfer the SQL command from client to Application Server?
#711
Author: mykle hoban (borland)
Date: Wed, 21 Feb 2001 19:48
19 lines
1631 bytes
The component is called TDatasetProvider. You can use the CommandText property
of your ClientDataset to dynamically set the SQL property. Note: you'll have to
set the poAllowCommandText = true in the DatasetProvider options.

Hope this helps,

_mykle

Will Hunt wrote:
> I want to let the client to dynamically generate the SQL command. I know in
> the c/s
> environment ,it's not difficult to realize it.But,now i adapted the midas
> mode ,and the system has been used for some time. I want to how to resolve
> it .I've seen some books,takling about BCB3.0 or4.0 , have introduce to
> resolve it through TProvider,but in BCB5 this component has seems to
> disappeared.
> Can anyone help me! THX
>
>                                 Willy
Re: how to transfer the SQL command from client to Application Server?
#713
Author: John Graham
Date: Sun, 25 Feb 2001 15:48
64 lines
3453 bytes
That'll work, but you can also instantiate an instance of the app. server dispatch
interface in your client.  You can then create app. server methods to have the app.
server perform any tasks you want, including modifying the SQL properties of your
TQuery objects.  You call these methods from your client through the dispatch
interface passing any required parameters.

The dispatch interface is instantiated as follows:

 SMSrvrDisp = new ISysManSrvrDisp();

If you're using a Socket connection bind it like this:
  SMSrvrDisp->Bind(WideString(SysManSocket->ServerName));

If you're using a DCOM Connection, bind it like this:
  SMSrvrDisp->Bind(DCOMConnection->GetServer());

Use the IsBound() method of the dispatch interface to make sure binding worked.

For example, SQL statements can be passed to an app. server method as a WideString
type using the WideString's Copy() method like this:

WideString  wsXfrHistSQL;

 // add the XfrHistQry SQL statement to the WideString
wsXfrHistSQL = "SELECT XFR.Time, XFR.Server, XFR.ClientCode, XFR.Action, "
"XFR.FileName, XFR.FileSize, XFR.FileDate "
"FROM XfrHistory AS XFR (NOLOCK) "
"WHERE  XFR.ClientCode = :ActCode "
"ORDER BY XFR.Time";

 // transmit the SQL statement up the pipe
SMSrvrDisp->SetXfrHistQrySql(wsXfrHistSQL.Copy());

App. server methods are easy to set up using the Type Library.  For the above
example, the parameter type for app. server method "SetXfrHistQrySql()" is BSTR.

The dispatch interface is descended from the TAutoDriver class.  Also see the AdHoc
example in your BCB Examples\Midas Folder.

Regards,
John

"mykle hoban (borland)" wrote:

> The component is called TDatasetProvider. You can use the CommandText property
> of your ClientDataset to dynamically set the SQL property. Note: you'll have to
> set the poAllowCommandText = true in the DatasetProvider options.
>
> Hope this helps,
>
> _mykle
>
> Will Hunt wrote:
>
> > I want to let the client to dynamically generate the SQL command. I know in
> > the c/s
> > environment ,it's not difficult to realize it.But,now i adapted the midas
> > mode ,and the system has been used for some time. I want to how to resolve
> > it .I've seen some books,takling about BCB3.0 or4.0 , have introduce to
> > resolve it through TProvider,but in BCB5 this component has seems to
> > disappeared.
> > Can anyone help me! THX
> >
> >                                 Willy
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads