Part 5: FrontPage + ACCESS database Modification
Now I am in the last section. After a few days of hard work, I am excited. Next we will talk about how to use FrontPage to modify the data in the ACCESS database.
The first step, of course, is to add webpages and so on. Now I will not repeat how to add them in detail, because the previous sections are very clear. In this document, we need to create an edit.htm webpage, an edit. ASP Webpage, and a modify. ASP Webpage. I am sorry, I am not sure about one of the previous sections, that is, there is no automatically numbered column in the database, some of them can be deleted again, and then the database can be re-added. This is very fast.
Follow the instructions above to create a webpage:
The edit.htm code is as follows:
<Body>
<Form name = "form1" method = "Post" Action = "Edit. asp">
Enter the student ID to modify:
<Input type = "text" name = "ID">
<Br>
<Input type = "Submit" name = "Submit" value = "Submit">
</Form>
</Body>
Edit. the ASP code is as follows (thanks to the enthusiastic help of netizens, this result is returned. I am also a newbie and write this content for everyone's progress, hope to help you)
<Body>
<%
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open "driver = {Microsoft Access Driver (*. mdb)}; DBQ =" & server. mappath ("fpdb/lianxi1.mdb ")
Temp = request. Form ("ID ")
Exec = "select * From lianxibiao1 where
Student ID = '"& temp &"'"
Set rs = server. Createobject ("ADODB. recordset ")
Rs. Open exec, Conn
%>
<Form name = "form1" method = "Post" Action = "Modify. asp">
<Table width = "748" border = "0" cellspacing = "0"
Cellpadding = "0">
<Tr>
<TD Height = "16"> <B> Student ID </B> </TD>
<TD Height = "16"> <B> name </B> </TD>
<TD Height = "16"> <B> Learning Type </B> </TD>
<TD Height = "16"> <B> school </B> </TD>
<TD Height = "16"> <B> major </B> </TD>
<TD Height = "16"> <B> contact number </B> </TD>
</Tr>
<Tr>
<TD>
<Input type = "text" name = "xuehao" value = "<% = RS (" student ID ") %>">
</TD>
<TD>
<Input type = "text" name = "XM" value = "<% = RS (" name ") %>">
</TD>
<TD>
<Input type = "text" name = "xuexilx" value = "<% = RS (" Learning Type ") %>">
</TD>
<TD>
<Input type = "text" name = "Xueyuan" value = "<% = RS (" ") %>">
</TD>
<TD>
<Input type = "text" name = "zhuanye" value = "<% = RS (" professional ") %>">
</TD>
<TD>
<Input type = "text" name = "dianhua" value = "<% = RS (" contact number ") %>">
</TD>
</Tr>
<Tr>
<TD>
<Input type = "Submit" name = "Submit" value = "Submit">
</Tr>
</Table>
</Form>
<%
Rs. Close
Set rs = nothing
Conn. Close
Set conn = nothing
%>
</Body>
The last is the modify. ASP code.
<Body>
<%
Set conn = server. Createobject ("ADODB. Connection ")
Conn. Open "driver = {Microsoft Access Driver (*. mdb)}; DBQ =" & server. mappath ("fpdb/lianxi1.mdb ")
Exec = "select * From lianxibiao1 where
Student ID = '"& request. Form (" xuehao ")&"'"
Set rs = server. Createobject ("ADODB. recordset ")
Rs. Open exec, Conn, 1, 3
If (Rs. EOF and Rs. bof) then
Response. Write "no" & request. Form ("xuehao ")
Else
RS ("name") = request. Form ("XM ")
RS ("Learning Type") = request. Form ("xuexilx ")
RS ("") = request. Form ("Xueyuan ")
RS ("professional") = request. Form ("zhuanye ")
RS ("contact number") = request. Form ("dianhua ")
Rs. Update
End if
Rs. Close
Set rs = nothing
Conn. Close
Set conn = nothing
%>
<% Response. Write "modified successfully! "%>
</Body>
Let's take a look at the results!
Click Submit to display the following interface:
Then you can modify it in the box and click Submit. Haha !!! After the modification is successful, output OK !!
It's over !!! Good luck !!!
Remember to indicate the source for sharing. It's not easy for me to write ~~~ Supported ~~~~ LZM