<%
'************************************
'Linkbruttocane per vademecum
'il database va messo in mdb-database
'************************************
strFile = "pannello.asp" 'il nome di questo file
strTable = "palinsesto" 'nome tabella
strKey = "ID" 'chiave primaria, contatore
bgHeaderColor = "Orange"
fontHeaderColor = "black"
bgColor1 = "Silver"
fontColor1 = "Black"
bgColor2 = "White"
fontColor2 = "Black"
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("database2.mdb")
'**************************************
'azioni da eseguire
'**************************************
Select Case Request("mode")
Case "AddItem"
AddItem
Case "AddItemAction"
AddItemAction
Case "EditItem"
EditItem
Case "EditItemAction"
EditItemAction
Case "DelItem"
delItem
Case Else
ShowAll
End Select
'**************************************
'mostrare tutti i record
'FORTEMENTE SCONSIGLIATO PER I DATABASE DI GRANDE DIMENSIONE
'**************************************
Sub ShowAll()
MySQL="Select * from " & strTable
Set MyRs=MyConn.Execute(MySQL)
Response.write (" Radio Nettuno " & strTable & " : da luned́ a venerd́ - sabato - domenica
")
Response.write ("")
Response.write ("")
numerocampi=MyRs.fields.count -1
for i=0 to numerocampi
if Not MyRs(i).name = "ID" then
Response.write ("| " & MyRs(i).name & " | ")
end if
next
Response.write ("
")
do while not MyRs.eof
if bgColor = bgColor2 then
bgColor = bgColor1
fontColor = fontColor1
else
bgColor = bgColor2
fontColor = fontColor2
end if
for i = 0 to numerocampi
if Not MyRs(i).name = "ID" then
if MyRs(i).name = "PRICE" then
ThisRecord = FormatCurrency(MyRs(i))
strAlign = "right"
else
ThisRecord = MyRs(i)
strAlign = ""
end if
If IsNull(ThisRecord) or ThisRecord = "" Then
ThisRecord = " "
end if
ThisRecord = Replace(ThisRecord,vbCrLf,"
")
Response.write ("" & Thisrecord & " | ")
end if
next
Response.write ("")
MyRs.movenext
loop
Response.write ("
")
MyRs.close
Set MyRs= Nothing
end sub
%>