Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
If (CStr(Request("MM_insert")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_conn_STRING
MM_editCmd.CommandText = "INSERT INTO dbo.Wz_ylm (ylm, ypx) VALUES (?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 50, Request.Form("ylm")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 5, 1, -1, MM_IIF(Request.Form("ypx"), Request.Form("ypx"), null)) ' adDouble
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "wz_lm.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Dim Recordset2
Dim Recordset2_cmd
Dim Recordset2_numRows
Set Recordset2_cmd = Server.CreateObject ("ADODB.Command")
Recordset2_cmd.ActiveConnection = MM_conn_STRING
Recordset2_cmd.CommandText = "SELECT max(yid) as yidzs FROM dbo.Wz_ylm"
Recordset2_cmd.Prepared = true
Set Recordset2 = Recordset2_cmd.Execute
Recordset2_numRows = 0
for i=0 to request("zs")
Set Command1 = Server.CreateObject ("ADODB.Command")
Command1.ActiveConnection = MM_conn_STRING
Command1.CommandText = "INSERT INTO dbo.Wz_elm (elm, epx, ssyl) VALUES ( '"&request("elm"&i)&"',"&request("epx"&i)&","&(Recordset2.Fields.Item("yidzs").Value)&") "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
next
Recordset2.Close()
Set Recordset2 = Nothing
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
Dim ylm
Dim ylm_cmd
Dim ylm_numRows
Set ylm_cmd = Server.CreateObject ("ADODB.Command")
ylm_cmd.ActiveConnection = MM_conn_STRING
ylm_cmd.CommandText = "SELECT * FROM dbo.Wz_ylm ORDER BY ypx ASC"
ylm_cmd.Prepared = true
Set ylm = ylm_cmd.Execute
ylm_numRows = 0
%>
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
ylm_numRows = ylm_numRows + Repeat1__numRows
%>
Dim MM_paramName
%>
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
无标题文档文章管理
已有栏目 | 添加新栏目 |
While ((Repeat1__numRows <> 0) AND (NOT ylm.EOF)) %> Dim yzs Dim yzs_cmd Dim yzs_numRows Set yzs_cmd = Server.CreateObject ("ADODB.Command") yzs_cmd.ActiveConnection = MM_conn_STRING yzs_cmd.CommandText = "SELECT count(yid) as yzs FROM dbo.VIEW2 WHERE yid="&(ylm.Fields.Item("yid").Value)&"" yzs_cmd.Prepared = true Set yzs = yzs_cmd.Execute yzs_numRows = 0 %> Dim elm__MMColParam elm__MMColParam = (ylm.Fields.Item("yid").Value) If (Request("MM_EmptyValue") <> "") Then elm__MMColParam = Request("MM_EmptyValue") End If %> Dim elm Dim elm_cmd Dim elm_numRows Set elm_cmd = Server.CreateObject ("ADODB.Command") elm_cmd.ActiveConnection = MM_conn_STRING elm_cmd.CommandText = "SELECT * FROM dbo.Wz_elm WHERE ssyl = ? ORDER BY epx ASC" elm_cmd.Prepared = true elm_cmd.Parameters.Append elm_cmd.CreateParameter("param1", 5, 1, -1, elm__MMColParam) ' adDouble Set elm = elm_cmd.Execute elm_numRows = 0 %> Dim Repeat2__numRows Dim Repeat2__index Repeat2__numRows = -1 Repeat2__index = 0 elm_numRows = elm_numRows + Repeat2__numRows %> | |
、(篇文章 ">查看) ">修改 |
While ((Repeat2__numRows <> 0) AND (NOT elm.EOF))
%>
Dim ezs
Dim ezs_cmd
Dim ezs_numRows
Set ezs_cmd = Server.CreateObject ("ADODB.Command")
ezs_cmd.ActiveConnection = MM_conn_STRING
ezs_cmd.CommandText = "SELECT count(eid) as ezs FROM dbo.VIEW2 WHERE eid="&(elm.Fields.Item("eid").Value)&""
ezs_cmd.Prepared = true
Set ezs = ezs_cmd.Execute
ezs_numRows = 0
%>
()(篇文章 ">查看)Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
elm.MoveNext()
Wend
%>
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
ylm.MoveNext()
Wend
%>
一级栏目名称 | 排序 | ||
二级栏目名称 1 2 3 4 5 6 7 8 9 | |||
ylm.Close()
Set ylm = Nothing
%>
elm.Close()
Set elm = Nothing
%>
ezs.Close()
Set ezs = Nothing
%>
yzs.Close()
Set yzs = Nothing
%>