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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft VBScript runtime error '800a005e'

Status
Not open for further replies.

huttemannw

Programmer
Feb 6, 2003
12
0
0
US
Hi,

The strContent parameter in the code below receives its value from a Memo field in an Access database. If I open the recordset with an adOpenForwardOnly cursor, no matter what value I send to strContent (empty string, Null, or a valid string), I get the error - Microsoft VBScript runtime error '800a005e' Invalid Use of Null - on the first Replace statement.

When I change the recordset cursor to a traversable cursor (i.e. Static, Keyset, or Dynamic), the code executes without a problem.

Is this a quirk with ADO, Access, or ASP? I have since changed the replace statements in the function to Replace(&quot; &quot; & strContent, &quot;<sq>&quot;, Chr(39)). However, I would still like to know why the recordset needs a traversable cursor when comparing a value from a Memo field.

Any help would be appreciated. Thanks.

'----------------------------------------
'Decodes CRLFs and quotes for HTML display
'----------------------------------------

Function Decoder(strContent, strControlType)
If Not strContent = &quot;&quot; And Not IsNull(strContent) Then
strContent = Replace(strContent, &quot;<sq>&quot;, Chr(39))
strContent = Replace(strContent, &quot;<dq>&quot;, Chr(34))

If strControlType = &quot;display&quot; Then
Decoder = Replace(strContent, vbCrLf, &quot;<br>&quot;)
Else
Decoder = strContent
End If
End If
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top