diff --git a/components/tvplanit/examples/datastores/json/unit1.pas b/components/tvplanit/examples/datastores/json/unit1.pas index fd3fbd2bc..4c64d8746 100644 --- a/components/tvplanit/examples/datastores/json/unit1.pas +++ b/components/tvplanit/examples/datastores/json/unit1.pas @@ -4,7 +4,7 @@ unit Unit1; { Activate this define to use a JSON string instead of a file } -{$DEFINE USE_JSON_STRING} +{.$DEFINE USE_JSON_STRING} interface diff --git a/components/tvplanit/source/vpjsonds.pas b/components/tvplanit/source/vpjsonds.pas index ceab4c81b..9f8301a3f 100644 --- a/components/tvplanit/source/vpjsonds.pas +++ b/components/tvplanit/source/vpjsonds.pas @@ -431,8 +431,8 @@ end; procedure TVpJSONDatastore.Loaded; begin inherited; - if not (csDesigning in ComponentState) then - Connected := AutoConnect; + if not (csDesigning in ComponentState) and AutoConnect then + Connected := true; end; procedure TVpJSONDatastore.LoadEvents; @@ -615,6 +615,9 @@ begin if (csDesigning in ComponentState) or (csLoading in ComponentState) then Exit; + if Value = Connected then + exit; + { Connecting or disconnecting? } if Value then ReadJSON