was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

32 Visitors Online


 
...eine Formula One Tabellenkalkulation in einem Blob Feld speichern?
Autor: Brett McLean
[ Tip ausdrucken ]  

Tip Bewertung (4):  
     


uses vcf1, dbtables;


procedure SaveSpreadsheet(F1Book: TF1Book);
var
  
BlobStream: TBlobStream;
  MyBlob: HGlobal;
  pblob: Pointer;
begin
  with 
Datamodule1.Query1 do
  begin
    
Set8087CW($133f);
    try
      
Application.ProcessMessages;
      F1Book.SaveWindowInfo;
      MyBlob := GlobalAlloc(GMEM_MOVEABLE, 2000);
      try
        
F1Book.WriteToBlob(MyBlob, 0);
        pBlob := globalLock(MyBlob);
        try
          
Blobstream := TBlobStream.Create(TBlobField(FieldByName('QUOTE_BLOB')),
            bmWrite);
          try
            
Blobstream.Write(pBlob^, GlobalSize(myBlob));
          finally
            
Blobstream.Free;
          end;
        finally
          
globalUnlock(MyBlob);
        end;
        F1book.IF1Book_Modified := False;
      finally
        
globalFree(myblob);
      end;
    finally
      
Set8087CW(Default8087CW);
      Application.ProcessMessages;
    end;
  end;
end;

//Depending on your Delphi Version (<D4), you will need:
//D4 und frühere Versionen brauchen noch:

var
  
Default8087CW: Word = $1332;

procedure Set8087CW(NewCW: Word);
asm
  
MOV     Default8087CW,AX
  FLDCW   Default8087CW
end;


 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners