Программирование в IIS


Пример 7.4


Server

<%

' Set up and open the database using the DSN

Set conn = Server.CreateObject("ADODB.Connection")

Set rs = Server.CreateObject("ADODB.Recordset")

conn.open "DSN=BeerBrewersDSN;"

rs.open "BeerBrewersTable", conn, 2, 3

' Add a new record using all the fields in the form

rs.addnew

rs("FirstName") = request("FirstName")

rs("LastName") = request("LastName")

rs("Address") = request("Address")

rs("City") = request("City")

rs("State") = request("State")

rs("Zip") = request("Zip")

rs("Country") = request("Country")

rs("Email") = request("Email")

' Update the records and close the connection

rs.update

rs.close

conn.close

' Always close out the objects to eliminate memory leaks

SET conn = Nothing

SET rs = Nothing

%>

Your information has been updated. You will receive the newsletter in 4-6 weeks

Thanks!




Начало  Назад  Вперед



Книжный магазин