Hi!
You're correct in your approach. No other ways. See also following links:
Articles Q145991 and Q245714 in MSDN
And
http://www.tek-tips.com/gthreadminder.cfm/lev2/4/lev3/27/pid/184/qid/28024You will find there solutions that propose Microsoft (with views), and solution I have found for SPT about how to read and write binary data into image field on SQL Server.
>I am trying to figure out how to build a database of images. The images are the important part of this database, so I don't want them sitting as files on a file server, I want them in image fields under the protection of Sql server. This seams to cause all sorts of headaches when trying to actually code anything.
>
>Using a Sql table like this:
>
>create table pics (
> pkPics smallint IDENTITY(1,1) PRIMARY KEY,
> cDesc varchar(50),
> iPic image
>
>and a remote view:
>
>create sql view rv_Pics remote connection ConMqis as ;
> select * from Pics
>
>dbsetprop( "rv_Pics", "view", "SendUpdates", .t. )
>dbsetprop( "rv_Pics", "view", "WhereType", 1 )
>
>dbsetprop( "rv_Pics.pkPics", "field", "KeyField", .t. )
>
>VFP maps the iPic sql field to a general filed in the vfp view. This didn’t help me much – I couldn’t get it to show it directly on a form, nor could I get it written back out to a file when I needed it. (btw, what is the inverse of APPEND GENERAL… ?) So I used
>
>dbsetprop( "rv_Pics.iPic", "field", "DataType", "M" )
>
>to map it to a memo field, so that I can use code like:
>
>* Get jpg into database
>append memo iPic from (lcFilNam) overwrite
>
>* display image on a form
>lcFilNam = SYS(2023) + "\iPic.jpg"
>STRTOFILE( iPic, lcFilNam )
>thisform.Image1.Picture = lcFilNam
>
>
>I am sure this is a previously solved problem, so if someone could point me to the previous solution, that would be grand.
>
>TIA, Carl Karsten
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.