<! -- # Include file = "Connections/Conn. asp" -->
<%
Set C. Createobject ("ADODB. Connection ")
Conn. c
Conn. Open
Set COM = server. Createobject ("ADODB. Command ")
Com. commandtext = "delete from portal_articles where ArticleID =" + request. querystring ("ArticleID ")
Com. activec
Com.exe cute ()
Response. Redirect ("admin_articles.asp ")
'Conn.exe cute ("insert into portal_articles (title, author, catid) values ('20170101', 'test', 5 )")
'Conn. Close ()
'Response. Redirect ("admin_articles.asp ")
%>
''Batch Delete Code
<% @ Language = "VBScript" codePage = "936" %>
<Script language = "JavaScript">
Function selectallcheckboxes (spanchk ){
VaR xstate = spanchk. checked;
VaR thebox = spanchk;
Elm = thebox. Form. elements; // obtain all controls in Form
For (I = 0; I <Elm. length; I ++)
If (ELM. Type = "checkbox" & elm. ID! = Thebox. ID)
{
If (ELM. Checked! = Xstate)
Elm. Click ();
}
}
</SCRIPT>
<! -- # Include file = "Connections/Conn. asp" -->
<%
'Get all selected ID strings
Dim myids
Myids = request. Form ("chkid ")
'Detach ID to the array
Dim articleids
Articleids = Split (myids ,",")
'Response. Write (ubound (articleids ))
'Connect to the database
'Response. Write (myids)
Set C. Createobject ("ADODB. Connection ")
Conn. c
Conn. Open
'''''''''''''''''''''''''''''''''''''''' '''
'Cycle to delete the selected ID
Dim I
For I = 0 to ubound (articleids)
Sqlstr = "delete from portal_articles where ArticleID =" + articleids (I)
Conn.exe cute (sqlstr)
'Response. Write (sqlstr + "<br/> ")
Next
Conn. Close
If ubound (articleids)> = 0 then response. Redirect ("admin_articles.asp") 'fixes the bug where the automatic code generated by Dreamweaver still displays the clear record.
%>
''Delete Code
<! -- # Include file = "Connections/Conn. asp" -->
<%
Set conn = server. Createobject ("ADODB. Connection ")
Conn. connectionstring = mm_conn_string
Conn. Open
Set COM = server. Createobject ("ADODB. Command ")
Com. commandtext = "delete from portal_articles where ArticleID =" + request. querystring ("ArticleID ")
Com. activeconnection = Conn
Com.exe cute ()
Response. Redirect ("admin_articles.asp ")
'Conn.exe cute ("insert into portal_articles (title, author, catid) values ('20170101', 'test', 5 )")
'Conn. Close ()
'Response. Redirect ("admin_articles.asp ")
%>
''Batch Delete Code
<% @ Language = "VBScript" codePage = "936" %>
<Script language = "JavaScript">
Function selectallcheckboxes (spanchk ){
VaR xstate = spanchk. checked;
VaR thebox = spanchk;
Elm = thebox. Form. elements; // obtain all controls in Form
For (I = 0; I <Elm. length; I ++)
If (ELM [I]. type = "checkbox" & elm [I]. ID! = Thebox. ID)
{
If (ELM [I]. Checked! = Xstate)
Elm [I]. Click ();
}
}
</SCRIPT>
<! -- # Include file = "Connections/Conn. asp" -->
<%
'Get all selected ID strings
Dim myids
Myids = request. Form ("chkid ")
'Detach ID to the array
Dim articleids
Articleids = Split (myids ,",")
'Response. Write (ubound (articleids ))
'Connect to the database
'Response. Write (myids)
Set conn = server. Createobject ("ADODB. Connection ")
Conn. connectionstring = mm_conn_string
Conn. Open
'''''''''''''''''''''''''''''''''''''''' '''
'Cycle to delete the selected ID
Dim I
For I = 0 to ubound (articleids)
Sqlstr = "delete from portal_articles where ArticleID =" + articleids (I)
Conn.exe cute (sqlstr)
'Response. Write (sqlstr + "<br/> ")
Next
Conn. Close
If ubound (articleids)> = 0 then response. Redirect ("admin_articles.asp") 'fixes the bug where the automatic code generated by Dreamweaver still displays the clear record.
%>