cheap nfl jerseys china cheap nfl jerseys free shipping wholesale nfl jerseys china wholesale jerseys from china cheap nfl jerseys free shipping cheap nfl jerseys for sale cheap jerseys free shipping wholesale nfl jerseys from china cheap nfl jerseys sale cheap nike nfl jerseys china wholesale jerseys free shipping cheap nfl jerseys wholesale wholesale nfl jerseys online cheap nfl jerseys wholesale china jerseys wholesale cheap coach handbags outlet authentic designer handbags cheap coach handbags outlet cheap coach purses outlet discount coach bags coach bags sale coach purse outlet cheap real coach purses coach handbags sale online coach purse outlet michael kors outlet online store cheap michael kors bags cheap michael kors purse michael kors factory outlet online cheap michael kors handbags cheap michael kors purses michael kors bags outlet online cheap michael kors purse michael kors handbags discount

Seminario introduttivo

1999 Roberto Anzellotti  - CASPUR

Interrogazione di Basi Dati tramite ASP-3

Vediamo come si possa riciclare il codice scritto una volta per pi� tabelle.
Quella che segue � una pagina ASP formata da una normale Form, con due righe ASP per gestire il dato inserito:

<HTML>
<BODY BGCOLOR=#FFFFFF>
<H1>Inserisci la tabella Desiderata</H1>
<FORM METHOD=POST ACTION="lista4.asp">
<P>Query:
<% sql = Request("sql")
if sql = "" Then
sql = "SQL_Elenco"
end if
%>

<P><TEXTAREA NAME="sql" ROWS=1 COLS=50><%=sql%></TEXTAREA><BR>
<P>

<INPUT TYPE=SUBMIT VALUE="Execute">
<INPUT TYPE=RESET VALUE="Reset">
</FORM>

</BODY>
</HTML>

Il dato inserito viene spedito alla pagina ASP precedentemente realizzata e modificata in 2 soli punti:

<HTML>
<BODY BACKGROUND="/sfondi/Image2.jpg" BGCOLOR="WHITE" VLINK="#646464" TEXT="GREEN" LINK="#C850C8">

<CENTER>
<B><FONT FACE="Comic Sans MS" SIZE=5 COLOR="#6464FF">Stampa di prova Tabella SQL_Elenco</FONT></B>
<P>
<%sql = Request("sql")%>

<%Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "Universo","web",""
sqli = "SELECT * FROM " & sql
Set RS = Conn.Execute(sqli)%>

Interrogazione effettuata:<BR><I><B> <%=sqli%></I></B>
<P>
<P>
<TABLE BORDER=1>
<TR>
<% For i = 0 to RS.Fields.Count - 1 %>
<TD><B><% = RS(i).Name %></B></TD>
<% Next %>
</TR>
<% Do While Not RS.EOF %>
<TR>
<% For i = 0 to RS.Fields.Count - 1 %>
<TD VALIGN=TOP><% = RS(i) %></TD>
<% Next %>
</TR>
<%RS.MoveNext
Loop
RS.Close
Conn.Close%>


</TABLE>
<BR>
<BR>
</BODY>
</HTML>

Clicca qu� per vedere queste ASP

Pagina precedente

Indice