Why I'm getting access violation when calling <DatasetDescendant>.FieldDefs.Find() ?
Hi,
I'm getting access violation when calling <DatasetDescendant>.FieldDefs.Find();
Here is my Code :
My PascalScript looks like this :
When executing it, I'm getting an access violation. Debugger stops in fs_idbrtti , function TFunctions.GetProp where TDataSet(Instance) is always nil ?
I'm getting access violation when calling <DatasetDescendant>.FieldDefs.Find();
Here is my Code :
      fsScript1.Clear;
      fsScript1.AddClass(TMyConnection, 'TCustomMyConnection');
      fsScript1.AddClass(TCustomMyConnection, 'TCustomDAConnection');
      fsScript1.AddClass(TCustomDAConnection, 'TCustomConnection');
      fsScript1.AddClass(TCustomConnection, 'TComponent');
      fsScript1.AddObject('MyConnection', AMyConnection);
      fsScript1.AddClass(TMyQuery, 'TCustomMyDataSet');
      fsScript1.AddClass(TCustomMyDataSet, 'TCustomDADataSet');
      fsScript1.AddClass(TCustomDADataSet, 'TMemDataSet');
      fsScript1.AddClass(TMemDataSet, 'TDataset');
      fsScript1.AddObject('Table',MyQuery);
      fsScript1.Lines.Text:= PasclScript;
      fsScript1.Parent := fsGlobalUnit; // use standard classes and methods
      fsScript1.SyntaxType := 'PascalScript';
      if fsScript1.Compile then
      fsScript1.Execute else
      ShowMessage(fsScript1.ErrorMsg);
My PascalScript looks like this :
If Table.FieldDefs.Find('User') <> nil then  Table.Fieldbyname('User').AsString := MyConnection.username;
When executing it, I'm getting an access violation. Debugger stops in fs_idbrtti , function TFunctions.GetProp where TDataSet(Instance) is always nil ?