<%
catName = ""
scatName = ""
I = 1
If mysql then
strsql = "SELECT tbCat.catID AS ID1st, tbCat.catName AS Name1st, tbCat.ads AS Ads1st, tbscat.sCatID AS ID2nd, tbscat.scatName AS Name2nd, tbscat.ads AS Ads2nd, tb3ID.sCatID AS ID3rd, tb3ID.scatName AS Name3rd, tb3ID.ads AS Ads3rd "
strsql = strsql & "FROM " & tablPfx & "Cat AS tbCat "
strsql = strsql & "LEFT JOIN " & tablPfx & "Scat AS tbscat ON tbscat.catID = tbCat.catID "
strsql = strsql & "LEFT JOIN " & tablPfx & "Scat AS tb3ID ON tb3ID.catID = tbscat.scatID "
strsql = strsql & "ORDER BY tbCat.catName, tbscat.scatName, tb3ID.scatName;"
Else
strsql = "SELECT tbCat.catID AS ID1st, tbCat.catName AS Name1st, tbCat.ads AS Ads1st, tbscat.sCatID AS ID2nd, tbscat.scatName AS Name2nd, tbscat.ads AS Ads2nd, tb3ID.sCatID AS ID3rd, tb3ID.scatName AS Name3rd, tb3ID.ads AS Ads3rd "
strsql = strsql & "FROM " & tablPfx & "Cat AS tbCat "
strsql = strsql & "LEFT JOIN (" & tablPfx & "sCat AS tbscat LEFT JOIN " & tablPfx & "sCat AS tb3ID ON tb3ID.catID = tbscat.scatID) "
strsql = strsql & "ON tbscat.catID = tbCat.catID "
strsql = strsql & "ORDER BY tbCat.catName, tbscat.scatName, tb3ID.scatName;"
End If
Set rsCat = objConn.Execute(strsql)
If not rsCat.EOF then
Response.Write vbcrlf & "
" & vbcrlf
Do while not rsCat.EOF
currcatName = rsCat("Name1st")
currscatName = rsCat("Name2nd")
currcat3rdName = rsCat("Name3rd")
If currcatName <> catName then
catName = currcatName
catID = rsCat("ID1st")
ads = rsCat("Ads1st")
If firstCatFound then
Response.Write "| | "
If I mod 3 = 0 then Response.Write " |
" & vbcrlf
I = I + 1
End If
If I mod 3 = 1 then Response.Write "