| |
<%
strTable = "Articoli2" 'nome tabella
strKey = "ID" 'chiave primaria, contatore
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("/mdb-database/usato_2.mdb")
MySQL="Select ID, Modello, Prezzo, Caratteristiche, Accessori, Foto from " & strTable & " ORDER BY ID DESC"
Set MyRs=MyConn.Execute(MySQL)
Response.write (" ")
Response.write ("")
numerocampi=MyRs.fields.count -1
for i=0 to numerocampi
if Not MyRs(i).name = "ID" then
if MyRs(i).name = "Accessori" then
ThisRecord = MyRs(i).name & " E PARTI SPECIALI"
else
ThisRecord = MyRs(i).name
end if
Response.write ("| " & ThisRecord & " | ") 'MyRs(i).name
end if
next
Response.write (" ")
do while not MyRs.eof
Response.write ("")
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
%>
|
|