piaffe
06-13-2005, 02:44 PM
I've been staring at this bit of code for well over an hour now and cant figure out what's wrong:
<%strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& _
Server.MapPath("..\private\db2.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open strConnect
Set objRS = Server.CreateObject("ADODB.RecordSet")
objRS.open "SELECT Business_Name, Address1, Address2, Town, City, County, Postcode, Postcode_2, Phone, Website_Address, Picture_Location FROM Sheet1 WHERE Take_Away = '"&Request.form("Take_Away")&"' AND City = '"&Request.form("City")&"'" ,objConn
Do While NOT objRS.EOF
Response.Write "<table><tr><td width=110><img src="& objRS("Picture_Location") & " width=100 height=100></td><td><b>"& objRS("Business_Name") & "</b><br>"& objRS("Address1") & ""& objRS("Address2") & "<br>"& objRS("Town") & "<br>"& objRS("City") & "<br>"& objRS("County") & "<br>"& objRS("Postcode") & " "& objRS("Postcode2") & "<br><a href="& objRS("Website_Address") & " target=_blank>"& objRS("Website_Address") & "</a><br><a href="& objRS("Picture_Location") & " target=_blank">Click For Menu</a></td></tr></table><hr>"
objRS.MoveNext '** goto the next record**
Loop
'*** clean up ***
objRS.close : objConn.close
%>
I get an error "Microsoft VBScript compilation error '800a0401'
Expected end of statement
/results.asp, line 188 "
This is the bit following the Response.Write
Any idea what im missing and from whereabouts?
Thanks
Laura
<%strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& _
Server.MapPath("..\private\db2.mdb")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open strConnect
Set objRS = Server.CreateObject("ADODB.RecordSet")
objRS.open "SELECT Business_Name, Address1, Address2, Town, City, County, Postcode, Postcode_2, Phone, Website_Address, Picture_Location FROM Sheet1 WHERE Take_Away = '"&Request.form("Take_Away")&"' AND City = '"&Request.form("City")&"'" ,objConn
Do While NOT objRS.EOF
Response.Write "<table><tr><td width=110><img src="& objRS("Picture_Location") & " width=100 height=100></td><td><b>"& objRS("Business_Name") & "</b><br>"& objRS("Address1") & ""& objRS("Address2") & "<br>"& objRS("Town") & "<br>"& objRS("City") & "<br>"& objRS("County") & "<br>"& objRS("Postcode") & " "& objRS("Postcode2") & "<br><a href="& objRS("Website_Address") & " target=_blank>"& objRS("Website_Address") & "</a><br><a href="& objRS("Picture_Location") & " target=_blank">Click For Menu</a></td></tr></table><hr>"
objRS.MoveNext '** goto the next record**
Loop
'*** clean up ***
objRS.close : objConn.close
%>
I get an error "Microsoft VBScript compilation error '800a0401'
Expected end of statement
/results.asp, line 188 "
This is the bit following the Response.Write
Any idea what im missing and from whereabouts?
Thanks
Laura