This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > March 2005 > Replace comma





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Replace comma
Aleks

2005-03-28, 6:34 pm

I am trying to replace a comma from a recordset field because is causing
problem when downloading to a csv file, I am trying the following:

<%=Replace(RepResults.Fields.Item("EmployerNm").Value,chr(44),"-")%>

But I get this error, I am using ASP/VB and MS SQL 2000

Technical Information (for support personnel)

a.. Error Type:
Microsoft VBScript runtime (0x800A005E)
Invalid use of Null: 'Replace'
/BlueDotBeta2005/Intranet/Reports/Advanced/Caseswithcommentsresultscsv.asp,
line 151


Tom Muck

2005-03-28, 6:34 pm

> <%=Replace(RepResults.Fields.Item("EmployerNm").Value,chr(44),"-")%>
>
> But I get this error, I am using ASP/VB and MS SQL 2000
>
> Technical Information (for support personnel)
>
> a.. Error Type:
> Microsoft VBScript runtime (0x800A005E)
> Invalid use of Null: 'Replace'
>

/BlueDotBeta2005/Intranet/Reports/Advanced/Caseswithcommentsresultscsv.asp,
> line 151


If this is a text field and you are using it somewhere else on the page, you
may have to create a string variable to hold the data first:

myVar = CStr(RepResults.Fields.Item("EmployerNm").Value)

Then when you need to display it or use it, use the variable instead:

<%=myVar %>
and
<%=Replace(myVar,chr(44),"-")%>



--
-------------------------------------------
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/

Extending Knowledge, Daily
http://www.CommunityMX.com/


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews