object EMPLOYEE: TSQLDataSet CommandText = 'EMPLOYEE' CommandType = ctTable SQLConnection = IBCONNECTION end object DataSetProviderEmployee: TDataSetProvider
DataSet = EMPLOYEE end
This server module is built in a very similar way to how it would have been in the past. What is new is the need to include in the program three new components that provide configuration and connectivity in place of the COM support (which is totally gone). The three components are:
In the demo these components are in the main form of the server, configured as follows:
object DSServer1: TDSServer AutoStart = True HideDSAdmin = False OnConnect = DSServer1Connect OnDisconnect = DSServer1Disconnect end object DSTCPServerTransport1: TDSTCPServerTransport PoolSize = 0 Server = DSServer1 BufferKBSize = 32 end object DSServerClass1: TDSServerClass OnGetClass = DSServerClass1GetClass Server = DSServer1 LifeCycle = 'Session' end
We'll get to some of the details of these properties later on. The reason you don't see the value of the TCP/IP port in the listing above is that I've not modified the default value of 211.
The only Delphi code you need to write is the "class factory" code that is needed to connect the DSServerClass1 component to the server module exposing the providers:
DSServerClass1GetClass(DSServerClass: TDSServerClass; var PersistentClass: TPersistentClass); begi n
PersistentClass := TDSFirst3TierServerModule; end;
This is all you need for the server. In the actual example I've added a logging statement to the method above, as well as to the event handlers of the OnConnect and OnDisconnect events of the DSServer component.
Again, there is no need to register it in any way. Simply run it, maybe using the Run | Run Without Debugging command of the Delphi IDE, so you can build the client and connect it to the server even at design time.
Was this article helpful?
What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.