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;