Re: Multi-step OLE DB operation error
From: Aaron [SQL Server MVP] (ten.xoc_at_dnartreb.noraa)
Date: 07/19/04
- Next message: Ray at <%=sLocation%> [MVP]: "Re: Multi-step OLE DB operation error"
- Previous message: Tyrel Schroeder: "Multi-step OLE DB operation error"
- In reply to: Tyrel Schroeder: "Multi-step OLE DB operation error"
- Next in thread: Tyrel Schroeder: "Re: Multi-step OLE DB operation error"
- Reply: Tyrel Schroeder: "Re: Multi-step OLE DB operation error"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 19 Jul 2004 14:01:37 -0400
Ugh, why all this code? Why a command object and a recordset object?
sql = "SELECT Extended_Notes FROM table" ' where ... ?
' or sql = "EXEC proc that SELECTs Extended_Notes"
set rs = conn.execute(sql)
eNotes = rs(0)
' ...
response.write eNotes
-- http://www.aspfaq.com/ (Reverse address to reply.) "Tyrel Schroeder" <TyrelSchroeder@discussions.microsoft.com> wrote in message news:B4311675-A0C2-4AF8-83CE-0A00AF890776@microsoft.com... > I've been trying to get data from an MSSQL database that has a text data type column. I'm using the GetChunk method (after verifying that adFldLong is set) and keep getting the following error message: > > Microsoft OLE DB Provider for ODBC Drivers (0x80040E21) > Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. > > The code that is causing the error message is below (it's taken from http://support.microsoft.com/default.aspx?scid=kb;EN-US;194975 but has been modified a little): > > <!-- Code snipped from above --> > RS2.Close > RS2.CursorType = 1 'adOpenKeySet > RS2.LockType = 3 'adLockOptimistic > Set RS2 = cmd2.Execute > If Not RS2.EOF Then > While NOT RS2.EOF > If IsNull(RS2("Extended_notes")) Then > MyTextFile.WriteLine("problem here") > Else > If (RS2("Extended_notes").Attributes AND adFldLong) = adFldLong Then > BlobToFile(RS2("Extended_notes")) > End If > End If > RS2.MoveNext > Wend > > Sub BlobToFile(fld) ' Modified from kbArticle > Dim sData, adLongVarChar, adLongVarWChar, FieldSize > > adLongVarChar = 201 > adLongVarWChar = 203 > > WriteFromUnsizedText fld ' Select statement eliminated here > End Sub > > Sub WriteFromUnsizedText(fld) > Dim Data, Temp, BLOCK_SIZE > > BLOCK_SIZE = 4096 > Do > Temp = fld.GetChunk(BLOCK_SIZE) ' Error occurs here > If IsNull(Temp) Then Exit Do > Data = Temp > Response.Write(Data) > Loop While Len(Temp) = BLOCK_SIZE > End Sub > > Any help would be greatly appreciated. Thanks in advance.
- Next message: Ray at <%=sLocation%> [MVP]: "Re: Multi-step OLE DB operation error"
- Previous message: Tyrel Schroeder: "Multi-step OLE DB operation error"
- In reply to: Tyrel Schroeder: "Multi-step OLE DB operation error"
- Next in thread: Tyrel Schroeder: "Re: Multi-step OLE DB operation error"
- Reply: Tyrel Schroeder: "Re: Multi-step OLE DB operation error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|