home *** CD-ROM | disk | FTP | other *** search
/ Total C++ 2 / TOTALCTWO.iso / vfp5.0 / vfp / samples / servers / gopher / srchdata.prg < prev    next >
Encoding:
Text File  |  1996-08-21  |  1.2 KB  |  39 lines

  1. * The idea behind this class being used in a a Custom OLE Server is that it
  2. * case provides a smart search buisness object which knows how and where to 
  3. * look across the network for a customer who may be located in 1 of 50
  4. * different databases (e.g., like a Gopher). 
  5. * This simple scenario here shows a similar search strategy, 
  6. * only the search paths being a local and a remote DBC. 
  7. * Local data = Testdata and Remote data = Tastrade.
  8. *
  9. * Note: make sure you change the Database path below to accommodate your VFP working directory.
  10. *
  11.  
  12. #DEFINE FOXHOME    "\VFP\"
  13.  
  14. DEFINE CLASS Gopher AS Custom OLEPUBLIC
  15.  
  16.     oDERef = ""
  17.  
  18.     PROCEDURE UpdateDE
  19.         PARAMETER oNewDE,lRemote
  20.         IF TYPE("oNewDE")#"O" OR ISNULL(m.oNewDE)
  21.             * Failed
  22.             RETURN .F.
  23.         ENDIF
  24.         THIS.oDERef = m.oNewDE
  25.         
  26.         IF !m.lRemote
  27.             * Use local data
  28.             THIS.oDERef.cursor1.database = FOXHOME + "SAMPLES\DATA\TESTDATA.DBC"
  29.             THIS.oDERef.cursor1.cursorsource = "Employee"
  30.         ELSE
  31.             * Use remote data (simiulated)
  32.             THIS.oDERef.cursor1.database = FOXHOME + "SAMPLES\TASTRADE\DATA\TASTRADE.DBC"
  33.             THIS.oDERef.cursor1.cursorsource = "Employee"
  34.         ENDIF
  35.         THIS.oDERef = ""
  36.     ENDPROC
  37.     
  38. ENDDEFINE