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!

Passing multiple DB vals via href - expected ')'

Status
Not open for further replies.

endoflux

Technical User
Aug 6, 2001
227
US
All--

I'm thinking this is one of those problems where there are an extra set of quotes or some other simple character messing it up; I've tried brackets and quotes in various places with no luck...whoever finds Waldo first gets a star!

When run, I get an error:

Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/sterilization/update_pick_sln.asp, line 23, column 21
Response.Write (""<a href="update_view_sln.asp?ID=" & rsSterile("Sterile_Lot_Number") & "&PN=" & rsSterile("Packaging_Lot_Number") & ">"")
--------------------^

This page should display all Sterile_Lot_Number records for the previously QueryString'ed Packaging_Lot Number. The results are supposed to be hyperlinks which will pass on the specific Packaging Lot Number and Sterile Lot Number clicked on via Querystring.

The error seems to be in this line:

Response.Write (""<a href="update_view_sln.asp?ID=" & rsSterile("Sterile_Lot_Number") & "&PN=" & rsSterile("Packaging_Lot_Number") & ">"")

Full Code:
<%
Dim adoCon
Dim rsSterile
Dim strSQL
Dim PNum
PNum = Request.QueryString("ID")
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("sterilization.mdb")
Set rsSterile = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM SterilizationLog WHERE Packaging_Lot_Number=" & "'" & Request.Form("packnumber") & "'"
rsSterile.Open strSQL, adoCon
%>
<font size=5 color=red face=Verdana>
<%
Response.Write Request.Form("packnumber")
%>
</font><br><br>
<%

Do While not rsSterile.EOF
Response.Write ("<br>")
Response.Write (""<a href="update_view_sln.asp?ID=" & rsSterile("Sterile_Lot_Number") & "&PN=" & rsSterile("Packaging_Lot_Number") & ">"")
Response.Write (rsSterile("Sterile_Lot_Number"))
Response.Write ("</a>")
Response.Write ("<br>")

rsSterile.MoveNext

Loop


rsSterile.Close
Set rsSterile = Nothing
Set adoCon = Nothing
%>

</td>
</tr>
</table>
</body>
</html>
 
give this a shot...

Code:
Response.Write ("<a href='update_view_sln.asp?ID=' & rsSterile("Sterile_Lot_Number") & "&PN=" & rsSterile("Packaging_Lot_Number") & ">")

-DNG
 
I think your quotes are messing you up. Try this and see if it helps:
Code:
Response.Write (""<a href="update_view_sln.asp?ID="[COLOR=red]""[/color] & rsSterile("Sterile_Lot_Number") & [COLOR=red]""[/color]"&PN="[COLOR=red]""[/color] & rsSterile("Packaging_Lot_Number") & ">"")
Or, you could simplify it more and just use single quotes (though I vaguely remember that they're not always the best way to go).
Code:
Response.Write ("<a href='update_view_sln.asp?ID=" & rsSterile("Sterile_Lot_Number") & "&PN=" & rsSterile("Packaging_Lot_Number") & ">'")

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
oops...one mistake

Code:
Response.Write ("<a href='update_view_sln.asp?ID=" & rsSterile("Sterile_Lot_Number") & "&PN=" & rsSterile("Packaging_Lot_Number") & ">'")

-DNG
 
What a crazy mess of quotes! I don't know that I fully understand how, but this one worked:

Response.Write ("<a href=""update_view_sln.asp?ID=" & rsSterile("Sterile_Lot_Number") & "&PN=" & rsSterile("Packaging_Lot_Number") & """>")

Thanks for the pointers guys!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top