Server 5: Relation Window

<< Click to Display Table of Contents >>

Navigation:  Examples > Server >

Server 5: Relation Window

Previous pageReturn to chapter overviewNext page

This sample shows the results of using 2 related servers on a DataWindow

It shows a subclass of AdoRelationServer that has an embedded child server


GLOBAL goConn AS AdoConnection

CLASS PubServer INHERIT AdoRelationServer

 EXPORT oTitles AS AdoRelationServer


METHOD Init() CLASS PubServer

 // Create a connection with the MsDataShape provider to the Pubs database


 goConn   := AdoConnection{}

 goConn:Open ( "Provider=SQLOLEDB;" + ;


 // Set the, so Vo2Ado can use the connection to get information

 // about the last errors that occurred



 // Create two related servers

 SUPER:init ( "select * from publishers",goConn,adOpenStatic,adLockReadonly,NIL)

 SELF:oTitles := AdoRelationServer{"select * from titles",;


 SELF:SetRelation(SELF:oTitles, #Pub_id)



The result is used on a Window