Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you return a text field to an RDO recordset? 2

Status
Not open for further replies.

Browner

Programmer
Mar 31, 2000
3
IE
I want to get a textfield from SQLServer into an RDO recordset in VB. I know about getchunk, but I want it in the RDO recordset, as in richtextbox = resultset!textfield. Can this be done? Any ideas would be appreciated. I am getting the resultset from a stored procedure if it makes any difference.<br><br>Thanks
 
Below is some outline code I used for saving stuff from a word doc to a text field. I haven't included all the code just the BLOB code.<br><br>sSql = &quot;Select * from issues &quot;<br><br>Set RS = cn.OpenResultset(sSql, rdOpenDynamic, rdConcurLock)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;DataFile = 1<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;If status = display Then GoTo update<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;RS.AddNew<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;If txtDir &lt;&gt; &quot;&quot; Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Const conChunkSize = 32768<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open filen For Binary Access Read As DataFile<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fl = LOF(DataFile)&nbsp;&nbsp;&nbsp;&nbsp;' Length of data in file<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Fl = 0 Then Close DataFile: Exit Sub<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Chunks = Fl \ conChunkSize<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fragment = Fl Mod conChunkSize<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RS!doc.AppendChunk Null<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ReDim Chunk(Fragment)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get DataFile, , Chunk()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RS!doc.AppendChunk Chunk()<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For i = 1 To Chunks<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ReDim Chunk(conChunkSize)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get DataFile, , Chunk()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RS!doc.AppendChunk Chunk()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Next i<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br><br><br>''''''''''''''''''''''''<br>Cal <p>Cal<br><a href=mailto: > </a><br><a href= > </a><br>
 
Thanks calahans,<br><br>I will give it a go.<br><br>
 
Excellent - gets me out of a hole - I've need some code like this for a while<br><br>trebort
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top