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

Please Help with this Script

Status
Not open for further replies.

rb74

Programmer
May 5, 2002
64
US
Hi all,

I am learning ASP on the fly, so please bear with me. I have a page that uses a JavaScript function that when you click a link a child browser opens with the appropriate web site. I am attempting to automate this using ASP with an Access DB connecting via ADO, and I am going over this code and I think it is a quotation mark issue. First off, here is the JavaScript function:

function showNewWindow(bookURL)
{
newWindow = window.open(bookURL,"r2d2","width=450,height=350,scrollbars=yes,top=250,left=250");
newWindow.focus();
return false;
}

straight forward...

here is my ASP script:

<%
Dim objCommand, objRS
Set objCommand = Server.CreateObject(&quot;ADODB.Command&quot;)

objCommand.ActiveConnection = strConnect
objCommand.CommandText = &quot;SELECT ClientName, URL FROM Clients &quot; &_
&quot;WHERE Status = 1 ORDER BY ClientName&quot;

objCommand.CommandType = adCmdText
Set objRS = objCommand.Execute
Set objCommand = Nothing

While Not objRS.EOF
Response.Write &quot;<tr height = 55><td align = center><img src = 'star.gif'></td>&quot; &_
&quot;<td><font face = 'Verdana, Arial, Helvetica'>&quot; &_
&quot;<a href=&quot;&quot;&quot;&quot; onClick&quot;&quot;return showNewWindow('&quot; & objRS(&quot;URL&quot;) & &quot;')&quot;&quot;>&quot; &_
objRS(&quot;ClientName&quot;) & &quot;</a></font></td></tr>&quot;

objRS.MoveNext
Wend

objRS.Close
Set objRS = Nothing
%>

just for additional reference, here is the original HTML

<tr height = &quot;55&quot;>
<td align = &quot;center&quot;><img src = &quot;star.gif&quot;></td>
<td><font face = &quot;Verdana, Arial, Helvetica&quot;><a href = &quot;&quot;
onclick=&quot;return showNewWindow(' Web Site </a></font></td>
</tr>

OK, I run the page, and the recordset returns the correct Clients, but when I click on the link, my IIS intro page appears instead of the web site needed. When I view the source of the ASP version of this page, the HTML looks correct just like in the original HTML.

I think it might have to do with all of the double quotation marks I have. I have tried all combinations, and I am not having any luck. Another bit of info: the URL's are stored in my Access DB as a Text datatype. I tried as a hyperlink, but this didn't work either.

Please point me in the right direction.

Rob
 
maybe this was just a typo in your ASP, but:

<a href=&quot;&quot;&quot;&quot; onClick&quot;&quot;return showNewWindow...

should be?

<a href=&quot;&quot;&quot;&quot; onClick=&quot;&quot;return showNewWindow...

also, when you included the &quot;original&quot; HTML, was that copy/pasted from view source after processing the page?

good luck!
 
Derrrr. I am so embarassed. Thanks Funka. That's the bone-head play of the day. Can anyone point me to a good ADO tutorial?


Thanks,

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top