N
Newbie
Hi I have and ADO Recordset created from the following line
set rsQuote = cmdQuote.execute (this runs an SP in SQL Server)
The text field in the recordset includes LineFeed characters which I want to
strip out - for this I use the code ** below but I get the following error.
Error: 3251
Current Recordset does not support updating. This may be a limitation of the
provider, or of the selected locktype.
How can I overcome this?
Here is the code to update the field have stripped the LineFeed characters:
rsQuote.MoveFirst
Do Until rsQuote.EOF
tmpStr = rsQuote.Fields("Text")
If Nz(tmpStr, "") = "" Then
rsQuote.MoveNext
Else
For i = 1 To (Len(Trim(tmpStr)))
If Mid(tmpStr, i, 1) = vbLf Then
strNotes = strNotes + " "
If Mid(tmpStr, i, 2) = vbLf + vbLf Then
i = i + 1
End If
Else
strNotes = strNotes + Mid(tmpStr, i, 1)
End If
Next
rsQuote.Fields("Text").Value = strNotes
rsQuote.MoveNext
End If
Loop
set rsQuote = cmdQuote.execute (this runs an SP in SQL Server)
The text field in the recordset includes LineFeed characters which I want to
strip out - for this I use the code ** below but I get the following error.
Error: 3251
Current Recordset does not support updating. This may be a limitation of the
provider, or of the selected locktype.
How can I overcome this?
Here is the code to update the field have stripped the LineFeed characters:
rsQuote.MoveFirst
Do Until rsQuote.EOF
tmpStr = rsQuote.Fields("Text")
If Nz(tmpStr, "") = "" Then
rsQuote.MoveNext
Else
For i = 1 To (Len(Trim(tmpStr)))
If Mid(tmpStr, i, 1) = vbLf Then
strNotes = strNotes + " "
If Mid(tmpStr, i, 2) = vbLf + vbLf Then
i = i + 1
End If
Else
strNotes = strNotes + Mid(tmpStr, i, 1)
End If
Next
rsQuote.Fields("Text").Value = strNotes
rsQuote.MoveNext
End If
Loop