From: koterski@NOSPAMgte.net (Steve Koterski) Subject: Re: putting bitmaps INTO a dbase blob field? Date: 13 Sep 1999 00:00:00 GMT Message-ID: <37df5ab7.16821833@news.gte.net> Distribution: world Content-Transfer-Encoding: 7bit References: <37DD2B77.7B45DBE9@rpinet.com> Content-Type: text/plain; charset=us-ascii X-Abuse-Info: Otherwise we will be unable to process your complaint properly X-Complaints-To: abuse@gte.net X-Trace: /bGnt5U8rAkQu51YysDzistZYEYH1IlWdVRd5Z0uLk/83IIaSYcYvp0dQeG83tIv9paqC3bw/3kd!MqiAcBv5bLtWv+pGe3hRIZ5nC6pZxFYRbJIuVb39e6bXB1nNinWcomKpuT/0 Organization: GTE Internet Solutions MIME-Version: 1.0 NNTP-Posting-Date: Mon, 13 Sep 1999 20:22:42 GMT Reply-To: koterski@NOSPAMgte.net Newsgroups: comp.lang.pascal.delphi.databases On Mon, 13 Sep 1999 09:51:03 -0700, Bill Burns wrote: >Many third party books, many FAQs, demo programs, etc. deal with how to >display graphics that are already captured and stored in a dbase or >paradox blob field. What about the other direction? I am trying to put >about 150 bitmaps into that many records in a dbf or db file, and I can >find little in the way of example code, at least that I can make run. [...] If you are using a TTable or TQuery component with an editable dataset, try the TBlobField.LOadFromFile method. (Table1.Fields[19] as TBlobField).LoadFromFile('c:\spot.bmp'); If you are using an INSERT statement executed from a TQuery, represent the BLOB field using a parameter in the SQL statement. Use the TParam.LoadFromFile method to copy from bitmap file to parameter. Use the Params property or ParamByName method of the TQuery to get this TParam reference. with Query1 do begin with SQL do begin Clear; Add('INSERT INTO "YourTable.dbf"'); Add('(FileNameField, TheBlobField)'); Add('VALUES (:FileNameParam, :BloFieldParam)'); end; Params[0].AsString := FileNameVar; Params[1].LoadFromFile('c:\spot.bmp'); ExecSQL; end; _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Steve Koterski "Health nuts are going to feel stupid someday, Felton, CA lying in hospitals dying of nothing."