%@language = vbscript%>
<%
Dim TijdelijkeData, Http_Adres, Site
Dim Achtergrond, DLKleur, Koptekst, HeaderPlaatje
dim conn_str
dim dr_filename, dr_version, dr_filesize, dr_fileloc, dr_url, dr_descr, dr_date, dr_Cat, dr_target
dim javascr_cnt
dim eerste_page
Page = Request("Page")
Http_Adres = "http://www.dynalink.com"
'Request.ServerVariables("HTTP_Host")
conn_str = "Provider=MSDASQL;Driver={SQL Server};Server=tlpsql1;Database=WebDB;UID=WebUser;Password=Come2MySite"
Site = 3
%>
Dynalink Global datacommunication solutions - Downloads
Announcement:
Windows XP drivers are available for most products. iIf there are no Windows XP drivers available, Windows 2000 drivers can be used.
<%
if is_category() = true then
%>
Category:
<%if Request.QueryString("fp") <> "1" then %>
Terug
<%else%>
Terug
<%end if%>
<% list_category() %>
<%else%>
Categorie:
<%= GetCategorie(page) %>
Files:
<%if Request.QueryString("fp") <> "1" then %>
Terug
<%else%>
Terug
<%end if%>
Drivernaam
Datum
Versie
<% list_Files() %>
<%end if%>
<%
function is_category()
' check if we still in the category list with this pagenr.
' otherwise we have to get the drivers in the list
dim ret
if page = "" then page = 0
Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
DatabaseConnection.ConnectionString = "Provider=MSDASQL;Driver={SQL Server};Server=tlpsql1;Database=WebDB;UID=WebUser;Password=Come2MySite"
DatabaseConnection.Open
sql = "Select * From SupportFiles Where CategoryNr = '"&Page&"';"
Set Rs_File = Server.CreateObject("ADODB.Recordset")
Rs_File.Open sql, DatabaseConnection,3,3
if rs_File.eof or rs_File.bof then
ret = true
Else
ret = false
End If
rs_File.close
set DatabaseConnection = nothing
is_category = ret
end function
sub list_category
Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
DatabaseConnection.ConnectionString = "Provider=MSDASQL;Driver={SQL Server};Server=tlpsql1;Database=WebDB;UID=WebUser;Password=Come2MySite"
DatabaseConnection.Open
SqlQuery = "Select * From Categorie Where SiteNr = '3' And Parent = '"&Page&"' Order By OmschrijvingExtern;"
Set RsCategory = DatabaseConnection.Execute(SqlQuery)
Do While Not RsCategory.EOF
'Response.Write "is de volgende een category (of file) : " & is_next_categorie(RsCategory("CategorieNr")) & " " & vbcrlf
if is_next_categorie(RsCategory("CategorieNr")) then
Response.Write "
"
end if
RsCategory.MoveNext
loop
RsCategory.close
set DatabaseConnection = nothing
end sub
function is_next_categorie(pg)
' check if we still in the category list with this pagenr.
' otherwise we have to get the drivers in the list
dim ret
if pg = "" then pg = 0
Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
DatabaseConnection.ConnectionString = "Provider=MSDASQL;Driver={SQL Server};Server=tlpsql1;Database=WebDB;UID=WebUser;Password=Come2MySite"
DatabaseConnection.Open
sql = "Select * From SupportFiles Where CategoryNr = '"&Pg&"';"
Set Rs_File = Server.CreateObject("ADODB.Recordset")
Rs_File.Open sql, DatabaseConnection,3,3
if rs_File.eof or rs_File.bof then
ret = true
Else
ret = false
End If
rs_File.close
set DatabaseConnection = nothing
is_next_categorie = ret
end function
sub list_files
Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
DatabaseConnection.ConnectionString = "Provider=MSDASQL;Driver={SQL Server};Server=tlpsql1;Database=WebDB;UID=WebUser;Password=Come2MySite"
DatabaseConnection.Open
'response.write " sql = " & "Select * From SupportFiles Where CategoryNr = '"&Page&"' Order By FileNaam;" & "
" & vbcrlf
SqlQuery = "Select * From SupportFiles Where CategoryNr = '"&Page&"' Order By FileNaam;"
Set RsFile = DatabaseConnection.Execute(SqlQuery)
javascr_cnt = 3
Do While Not RsFile.EOF
dr_Cat = GetCategorie(Page)
dr_filename = trim(Replace(UCase(RsFile("FileNaam"))," ",""))
dr_fileloc = Replace(RsFile("FileLocatie")," ","")
dr_url = Http_Adres & dr_fileloc
dr_filesize = GetFileSize(RsFile("FileLocatie"))
dr_descr = trim(Replace( RsFile("OmschrijvingNr"), " ",""))
dr_date = DatumFormat("D",RsFile("Datum"))
dr_version = Replace(RsFile("VersieNr")," ","")
if dr_version = "" then dr_version = "n/a"
file_ext = right(dr_filename, len(dr_filename) - instr(1,dr_filename,"."))
if lcase(file_ext) = "exe" or lcase(file_ext) = "com" or lcase(file_ext) = "dll" or lcase(file_ext) = "zip" or lcase(file_ext) = "tar" or lcase(file_ext) = "sit" or lcase(file_ext) = "bin" or lcase(file_ext) = "dll" then
dr_target = "_self"
else
dr_target = "_blank"
end if
filenr = RsFile("FileNr")
mouseovr = "moveTt('file" & filenr & "',x,y);showTt('file" & filenr & "')"
mouseout = "hideTt('file" & filenr & "')"
Response.Write "
"
RsFile.MoveNext
loop
rsFile.close
set DatabaseConnection = nothing
end sub
Function GetFileSize(Bestand)
Dim ObjConnection, BestandObj, hulp1
If site = "5" Then
Bestand = "d:\InetPub" & Replace(Bestand,"/","\")
Else
Bestand = "\\tlpwww\2LWeb" & Replace(Bestand,"/","\")
End If
'On Error Resume Next
Set ObjConnection = CreateObject("Scripting.FileSystemObject")
If ObjConnection.FileExists(Bestand) Then
Set BestandObj = ObjConnection.GetFile(Bestand)
Hulp1=BestandObj.Size
'On Error Goto 0
'If Hulp1 = "" Then
'GetFileSize = "File not found!"
'Else
Select Case True
Case Hulp1 < 1000
GetFileSize=Hulp1& " b"
Case Hulp1 < 1000000 And Hulp1 > 999
GetFileSize=Left(Hulp1,Len(Hulp1)-3)&"."&Mid(Hulp1,Len(Hulp1)-2,2)&" Kb"
Case Hulp1 < 1000000000 And Hulp1> 999999
GetFileSize=Left(Hulp1,Len(Hulp1)-6)&"."&Mid(Hulp1,Len(Hulp1)-5,2)&" Mb"
End Select
Else
GetFileSize = "File not found!"
End If
End Function
Function GetCategorie(Waarde)
Dim Categorie, Hulp1, Hulp2
If Waarde <> 0 Then
Hulp1 = Waarde
Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
DatabaseConnection.ConnectionString = "Provider=MSDASQL;Driver={SQL Server};Server=tlpsql1;Database=WebDB;UID=WebUser;Password=Come2MySite"
DatabaseConnection.Open
SqlQuery = "Select * From Categorie Where SiteNr = '"&Site&"' And CategorieNr = '"&Hulp1&"';"
Set RsCategory = DatabaseConnection.Execute(SqlQuery)
Categorie = Replace(RsCategory("OmschrijvingExtern")," ","")
Do While Hulp1 <> "0"
Hulp1 = RsCategory("Parent")
If Hulp1 <> 0 Then
SqlQuery = "Select * From Categorie Where SiteNr = '"&Site&"' And CategorieNr = '"&Hulp1&"';"
Set RsCategory = DatabaseConnection.Execute(SqlQuery)
Hulp2=Replace(RsCategory("OmschrijvingExtern")," ","")
If Right(Hulp2,1) = " " Then
Hulp2=Left(Hulp2,Len(Hulp2)-1)
End If
'Categorie = "" & " >> " & Categorie
Categorie = Hulp2 & " >> " & Categorie
End If
Loop
RsCategory.close
set DatabaseConnection = nothing
End If
GetCategorie = Categorie
End Function
%>