1
在一個形式的元素創建此richiesta.html:插入使用ASP和保存到DB
<HTML>
<BODY>
<table border> //create a simple table
<tr>
<td>
<form ACTION="richiesta.asp"> //open the file richiesta.asp
<table> //start a table format
<tr><td><input name="cognome" size="20"/></tr> //contain a input text
</table>
</form>
</td>
</tr>
<td><input type="submit" value="Invia"></td><td> // contein a button to send value to DB
</table>
</BODY>
</HTML>
創建richiesta.asp:
<HTML>
<BODY>
<%
cognome = Request.Form("cognome")
%>
<%
Session.timeout = 1 //Check the session
If IsObject(Session("iscrizioni")) Then
Set conn = Session("iscrizioni")
Else
Set conn = Server.CreateObject("ADODB.Connection") //Check the connection
conn.open "iscrizioni"
Set Session("iscrizioni") = conn
End If
%>
<%
If Stato = "" Then
SQL="INSERT INTO iscrizioni (Cognome) VALUES ("SQL=SQL & "'" & cognome & "', "SQL=SQL ")
response.write(SQL) //
conn.execute(SQL) // Insert value
conn.close //Close the connection
%>
// // 尾頁 我想插入在BD Anagrafica,表Anagrafica學生的名字。 DB結構:
地方提交按鈕表單:) –