FoxDataObjects

Object-Relational Mapping Tool for Visual FoxPro®

 OnLoad  Event

 

 

Occurs at early server object instantiation process before server object members initialize.

 PROCEDURE Server.OnLoad

 

Return Value

 

Boolean

Remarks

 

This event fires on server instantiation after Error collection creation and  before any other server member is initialized or created.

Returning a .F. (False) value, the initialization is cancelled and server object is not instantiated. You can use this event to prevent server instantiation at specific conditions.

In order to use custom code for server level events, the server object must be created from a custom fdoServer subclass. You can implement custom code on the corresponding subclass methods.

 

Example

oServer=CREATEOBJECT("MyServer")

 

...

 

DEFINE CLASS MyServer AS fdoServer OF fdo

     ...

    PROCEDURE OnLoad

        IF ! This.CertainConditionIsMet()

            ? "Server is not going to be instantiated ..."

            RETURN .F.

        ENDIF

        ? "Server will be instantiated ..."

    ENDPROC

     ...

ENDDEFINE

 

 

 

See Also

Server.NewSession method | Server.AfterInit event | Server.OnLoad event | Server.OnDestroy event

Applies to: Server object

Send feedback on this topic to RunAhead Technologies

For Technical support and product issues please contact us at support@foxdataobjects.com or visit http://www.foxdataobjects.com

Copyright (c) 2000-2005 RunAhead Technologies