Re: SQL Image to rich text box
- From: "Andrew D. Newbould" <newsgroups@xxxxxxxxxxxxxxxxx>
- Date: Tue, 7 Jun 2005 22:35:23 +0100
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 .
- Follow-Ups:
- Re: SQL Image to rich text box
- From: Mark
- Re: SQL Image to rich text box
- References:
- SQL Image to rich text box
- From: Mark
- SQL Image to rich text box
- Prev by Date: Visual Studio 2003 to SQl Server 2000
- Next by Date: Re: passing parameters between forms
- Previous by thread: SQL Image to rich text box
- Next by thread: Re: SQL Image to rich text box
- Index(es):
Relevant Pages
|