And from the beginning and &
sql1 = "SELECT p1.Cat1ID, p1.Cat2ID, c1.Cat1Name, c2.Cat2Name" & _
"FROM tblProducts AS p1, tblMainCat AS c1, tblCat2nd AS c2" & _
"WHERE p1.Cat1ID = c1.ID AND p1.Cat2ID = c2.ID AND Cat1Name = '" & request.querystring("maincat") & "'"
http://www.eatdrinkandsleep.com