Using Streams to access sql server

edited August 2008 in FastCube
Hi everybody!

i'm new in fast cube programming and i would like to know how can i use streams to save a cube and a scheme...

I want to save a cube to the database and load it from the database too!

Please ppl help me!!!

PROGRAMMING LANGUAGE: Delphi

Greetings to all

Comments

  • edited October 2008
    Hi.

    For example:
    Save schema
    procedure Tfm_cm_FCCube.ai_SaveSchemaExecute(Sender: TObject);
    var
      TempStream : TStringStream;
      ASchema : String;
    begin
      try
        TempStream := TStringStream.Create('');
        try
          TempStream.Position := 0;
          fcSlice.SaveToStream(TempStream);
          ASchema := TempStream.DataString;
        finally
          TempStream.Free;
        end;   (*try*)
        qu_UpdQuerys.ParamByName('NameQuery').AsString := ANameQuery;
        qu_UpdQuerys.ParamByName('Schema').AsBlob       := ASchema;
        qu_UpdQuerys.ExecSQL;
      except
      end;   (*try*)
    end;
    

    Load schema
    procedure Tfm_cm_FCCube.ai_LoadSchemaExecute(Sender: TObject);
    var
      TempStream : TStringStream;
      ASchema : String
    begin
      ASchema := qu_Querys.FieldByName('Schema').AsBlob;
      if ASchema <> '' then
      begin
        try
          TempStream := TStringStream.Create(ASchema);
          try
            TempStream.Position := 0;
            fcSlice.LoadFromStream(TempStream);
          finally
            TempStream.Free;
          end;   (*try*)
        except
        end;   (*try*)
      end;   (*if*)
    end;
    

    Oleg.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.