On Wed, Jun 10, 2009 at 11:25 AM, Vince Teachout<[email protected]> wrote:
> Is there a way to figure out what a view does behind the scenes?
>
> For example, I have an Image field in a SQL server table, and a view on
> that table in vfp.
>
> If I use views:
> Insert into myview (key, myimage) values('123', cstring)
> it works fine.
>
> The MyImage view field is blob, and the field on the server is image.
>
> But if I try SQLExec with this:
> "Insert into myview (key, myimage) values('123', '" + cstring + "')"
>
> It crashes complaining about a quote within the cString (entirely possible)
>
> I'd like to find out how the view handles it, so I can mimic it in my
> code.  Any suggestions?  Thanks.
--------------------------------------------------------

A blob is not "char" based in SQL Server, nor Oracle, DB2.

Because VFP says "Oh he didn't know what to do I'll just hold it for
now" and you only get the error from the backend.  You think that the
backend is wrong.  It isn't.

In essence you are treating all types of data like an email accepts
attachments.  I'll convert the file to string on this side and the
client on the other end has to convert back to the proper file type
later on.

Well  there is no conversion in your description from string to proper
file type before use.

This is not the first time images and storage in a DB have been a
problem.  You just have to stop that use of cstring in your insert.
[values('123', '" + cstring + "')"]

You will have to make the conversion before hand and pass that value
instead.  I experienced that when 2000 came out so it was a long time
ago.



-- 
Stephen Russell
Sr. Production Systems Programmer
Web and Windows Development
Independent Contractor
Memphis TN

901.246-0159

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to