%@ Language=VBScript CODEPAGE=65001%>
<%Option Explicit
Response.Charset="UTF-8"%>
<%
Dim gobjDB,arrPhotos,gintTotal,gstrEN,gstrGR
If Request.QueryString("lang")<>"" Then
Session("Language")=UCASE(Request.QueryString("lang"))
End If
Select Case Session("Language")
Case "GR"
gstrGR="GR"
Case "EN"
gstrEN="EN"
Case Else
Session("Language")="GR"
End Select
%>
<%=translate("mikhalisfarsaris")%> - Photos
">
<%=translate("news")%>">
<%=translate("photos")%>
<%=translate("Crete")%>
<%Call GetCategories("Crete")%>
Abroad
<%Call GetCategories("Abroad")%>
<%
Sub GetCategories(pstrCat)
Dim strSQL, rs, strSQL1, rs1,i,rsArray,connection,connectionString
'On Error Resume Next
strSQL =" SELECT distinct subcategory " & _
" FROM farPhotos " & _
" WHERE category='"& pstrCat &"'"
'Response.Write strSQL
'Response.End
Set connection = CreateObject( "ADODB.Connection" )
connectionString = "Provider=SQLOLEDB; Data Source=91.199.151.166\SQLEXPRESS; Initial Catalog=vincent; User Id=vincent; Password=th&%Y09?K"
connection.Open connectionString
Set rs = CreateObject( "ADODB.recordset" )
rs.Open strSQL,connection
If Err Then
Response.Write "Failed to select from News table. "
Response.Write "Err=" & Err.number & "/" & Err.description & " "
Response.Write "SQL: " & strSQL & " "
Exit Sub
End If
If not rs.EOF Then
rsArray=rs.GetRows()
gintTotal=Ubound(rsArray,2)
For i=0 to gintTotal
strSQL1 =" SELECT top 1 photo " & _
" FROM farPhotos " & _
" WHERE subcategory='"& rsArray(0,i) &"'" & _
" ORDER BY photo "
Set rs1 = CreateObject( "ADODB.recordset" )
rs1.Open strSQL1,connection
Response.Write ""
Response.Write "
" & rsArray(0,i) & " "
Do while not rs1.EOF
Response.Write "
"
rs1.movenext
Loop
Response.Write "
"
Next
End If
set rs=nothing
connection.Close
Set connection = Nothing
End Sub
%>