Re: SQL Image to rich text box



In message <oOfoe.1211$BQ3.304@xxxxxxxxxxxxxxxxxxxx>, Mark <mark@xxxxxxxxxx> writes
Hi

I am attempting to load data from an ADO recordset (data type = image on SQL
server) into a rich text box. I can save data from the box to the server ok
but I can't display it :@(

I keep getting errors along the line 'cast byte from string not valid'
running

pNoteRTF.Rtf=rs("noteRTF").Value

Firstly, SQL Server's image data type is defined as adVarLongBinary in ADO so your code is failing for good reasons. You need to use the GetChunk / AppendChunk methods of the Fields collection to manipulate its content.


Also, would I be better off storing the rtf as a file as opposed to an image
maybe?

Depends on your requirements. Personally, I don't like storing files on any type within a database unless I really have to. If the system is on a LAN you could store a link to the real file within your database and then make open the file from that public share.


--
Andrew D. Newbould                  E-Mail:  newsgroups@xxxxxxxxxxxxxxxxx

ZAD Software Systems                Web   :  www.zadsoft.com
.



Relevant Pages

  • Re: Confusion about store size, event log messages, deleted items...
    ... Thanks for all your help on this one Rich... ... I am waiting on approval for some new drives for the server and I anticipate that coming through any day now. ... When it does and I take the server down to work on it, I will move all the mailboxes. ... It is scheduled and completes before the exchange maintenance window starts so that there are't "too many cooks in the kitchen" working on the database. ...
    (microsoft.public.exchange.admin)
  • Create SharePoint Portal failed.
    ... One mentioned ensuring that SQL Server uses a case ... 13:55:40 Service database server is 'USDC-JOHRIV'. ... Update dbo.propertylist set DisplayName = N'Last name' ...
    (microsoft.public.sharepoint.portalserver)
  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Web Developers - Happy Hearts And HDTV! - Lockergnome
    ... Certificate on your MSIIS Web server. ... getting data from a database is only half the problem. ... Zend recently started a series about building rock solid code in PHP. ... which provides bulk database conversion. ...
    (freebsd-questions)
  • Re: TNS could not resolve the connect identifier
    ... This database resides on Machine A. ... The Web server is running on Machine B. ... Using tnsping is not as good as using a real connection such as via ... client (note that this is terminology that appears in the 10g R2 ...
    (comp.databases.oracle.server)