Code Comments
Programming Forum and web based access to our favorite programming groups.I have the following. I've tried swapping the " and ' in and around and
can't get the right syntax.
<%
varA = "<a href=" & "article.asp?id=" & (rsHead.Fields.Item("ID").Value) &
">Article</a>"
%>
My end results are: Type mismatch: '[string: "<a href=article.asp?"]'
Can someone lend a thought?
thanks
Post Follow-up to this message<%
varA = "<a href='article.asp?id=" & rsHead.Fields.Item("ID").Value & "'>Arti
cle</a>"
%>
'dlbjr
'Pleading sagacious indoctrination!
Post Follow-up to this messageNope...
Type mismatch: '[string: "<a href='article.asp"]'
thanks
"dlbjr" <oops@iforgot.com> wrote in message
news:enjYsbUvEHA.1404@TK2MSFTNGP11.phx.gbl...
> <%
> varA = "<a href='article.asp?id=" & rsHead.Fields.Item("ID").Value &
> "'>Article</a>"
> %>
>
> 'dlbjr
> 'Pleading sagacious indoctrination!
>
>
Post Follow-up to this message<%
strData = rsHead.Fields.Item("ID").Value
Response.Write strData & "<BR>"
Response.Flush
If Len(strData) > 0 Then
varA = "<a href='article.asp?id=" & rsHead.Fields.Item("ID").Value & "'>Arti
cle</a>"
End If
%>
This will let you see what is returned
--
'dlbjr
'Pleading sagacious indoctrination!
Post Follow-up to this messageDid you copy and paste that from your ASP file? And are you that that is
the line in error? I don't see anything syntactically incorrect.
Try:
<%
varA = "<a href=""article.asp?id=" & rsHead.Fields.Item("ID").Value &
""">Article</a>"
%>
Ray at home
"shank" <shank@tampabay.rr.com> wrote in message
news:ey6pjSUvEHA.3376@TK2MSFTNGP12.phx.gbl...
>I have the following. I've tried swapping the " and ' in and around and
>can't get the right syntax.
>
> <%
> varA = "<a href=" & "article.asp?id=" & (rsHead.Fields.Item("ID").Value) &
> ">Article</a>"
> %>
>
> My end results are: Type mismatch: '[string: "<a href=article.asp?"]'
>
> Can someone lend a thought?
> thanks
>
Post Follow-up to this messageTry loosing the db field and build the string with a dummy value, also all
variables in ASP are variants so you may need to perform a CSTR on the db
field, ie:
<%
Dim varA
'..With dummy value
varA = "<a href='article.asp?id=1'>Article</a>"
'..Then maybe
varA = "<a href='article.asp?id=" & CStr("" &
rsHead.Fields.Item("ID").Value) & "'>Article</a>"
%>
Hope this is helpful,
Stephen.
.
"shank" wrote:
> I have the following. I've tried swapping the " and ' in and around and
> can't get the right syntax.
>
> <%
> varA = "<a href=" & "article.asp?id=" & (rsHead.Fields.Item("ID").Value) &
> ">Article</a>"
> %>
>
> My end results are: Type mismatch: '[string: "<a href=article.asp?"]'
>
> Can someone lend a thought?
> thanks
>
>
>
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.