For Programmers: Free Programming Magazines  


Home > Archive > ASP > October 2004 > syntax issues









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 syntax issues
shank

2004-10-28, 8:55 pm

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


dlbjr

2004-10-28, 8:55 pm

<%
varA = "<a href='article.asp?id=" & rsHead.Fields.Item("ID").Value & "'>Article</a>"
%>

'dlbjr
'Pleading sagacious indoctrination!


shank

2004-10-28, 8:55 pm

Nope...
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!
>
>



dlbjr

2004-10-28, 8:55 pm

<%
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 & "'>Article</a>"
End If
%>

This will let you see what is returned
--
'dlbjr
'Pleading sagacious indoctrination!


Ray Costanzo [MVP]

2004-10-28, 8:55 pm

Did 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
>



StephenMcC

2004-10-29, 8:55 am

Try 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
>
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com