你可以用
F1Book1.Write (pPathName, nSaveType)
写到一个文件
然后把这个文件写到数据库中
给你个例子:
if OpenDialog1.Execute then
begin
if OpenDialog1.FileName = '' then Exit;
FileName := OpenDialog1.FileName;
Mem := TMemoryStream.Create;
Mem.LoadFromFile(FileName);
Mem.Seek(0,soFromBeginning);
Query1.Close;
Query1.DatabaseName := 'D:/BLOB';
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('INSERT INTO BLOBNAME(NAME,FILENAMES) VALUES
NAME,:FILENAMES)');
Query1.ParamByName('Name').AsString := FileName;
Query1.ParamByName('FileNAMES').LoadFromStream(Mem,ftBlob);
Query1.ExecSQL;
Mem.Free;
end;