麻烦高手详细翻译下ASP语句 谢谢~
发布网友
发布时间:2024-09-26 04:30
我来回答
共1个回答
热心网友
时间:2024-10-05 11:28
怎么看怎么象DW生成的垃圾
我大概给你解释一下
这些代码是要创建一个数据库表
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/EmpMain.asp" -->
<!--#include file="EmpMain_CheckRight.asp"-->
以上是这个页面需要调用的两个文件
<%call fnCheckRight("EmpList","2")%> 调用一个函数
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
以上是声明的变量
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) 取得当前页的文件名
If (Request.QueryString <> "") Then 如果为空则执行下面的语句
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert")) = "form1") Then
MM_editConnection = MM_EmpMain_STRING
MM_editTable = "EmpGeneralInfo"
MM_editRedirectUrl = "EmpMain_AddNew_Sucess.asp"
MM_fieldsStr 定义表的字段= "EmpCompID|value|EmpName|value|EmpEnglishName|value|EmpGender|value|EmpBirthday|value|EmpNativePlace|value|EmpNativeAddress|value|EmpSelfID|value|EmpFinallevel|value|EmpNowAddress|value|EmpNowTel|value|EmpEvenAddress|value|EmpEvenTel|value|EmpCommAddress|value|EmpZipcode|value|EmphireDate|value|EmpTrueDate|value|EmpHireDep|value|DMTitle|value|isTemp|value"
MM_columnsStr 定义表的列是否可以为空= "EmpCompID|',none,''|EmpName|',none,''|EmpEnglishName|',none,''|EmpGender|',none,''|EmpBirthDay|',none,NULL|EmpNativePlace|',none,''|EmpNativeAddress|',none,''|EmpSelfID|',none,''|EmpFinallevel|',none,''|EmpNowAddress|',none,''|EmpNowTel|',none,''|EmpEvenAddress|',none,''|EmpEvenTel|',none,''|EmpCommAddress|',none,''|EmpZipcode|',none,''|EmphireDate|',none,NULL'|EmpTrueDate|',none,NULL|EmpHireDep|',none,''|EmpTitle|',none,''|IsTemp|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|") 分割出变量里的所有字段
MM_columns = Split(MM_columnsStr, "|") 分割出变量里的所有列
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 取得所有字段
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i))) 取得所有字段后面的value
Next
下面这段没看明白
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
基本上就是这些了
DW没用过,呵呵
热心网友
时间:2024-10-05 11:28
怎么看怎么象DW生成的垃圾
我大概给你解释一下
这些代码是要创建一个数据库表
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/EmpMain.asp" -->
<!--#include file="EmpMain_CheckRight.asp"-->
以上是这个页面需要调用的两个文件
<%call fnCheckRight("EmpList","2")%> 调用一个函数
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
以上是声明的变量
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) 取得当前页的文件名
If (Request.QueryString <> "") Then 如果为空则执行下面的语句
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert")) = "form1") Then
MM_editConnection = MM_EmpMain_STRING
MM_editTable = "EmpGeneralInfo"
MM_editRedirectUrl = "EmpMain_AddNew_Sucess.asp"
MM_fieldsStr 定义表的字段= "EmpCompID|value|EmpName|value|EmpEnglishName|value|EmpGender|value|EmpBirthday|value|EmpNativePlace|value|EmpNativeAddress|value|EmpSelfID|value|EmpFinallevel|value|EmpNowAddress|value|EmpNowTel|value|EmpEvenAddress|value|EmpEvenTel|value|EmpCommAddress|value|EmpZipcode|value|EmphireDate|value|EmpTrueDate|value|EmpHireDep|value|DMTitle|value|isTemp|value"
MM_columnsStr 定义表的列是否可以为空= "EmpCompID|',none,''|EmpName|',none,''|EmpEnglishName|',none,''|EmpGender|',none,''|EmpBirthDay|',none,NULL|EmpNativePlace|',none,''|EmpNativeAddress|',none,''|EmpSelfID|',none,''|EmpFinallevel|',none,''|EmpNowAddress|',none,''|EmpNowTel|',none,''|EmpEvenAddress|',none,''|EmpEvenTel|',none,''|EmpCommAddress|',none,''|EmpZipcode|',none,''|EmphireDate|',none,NULL'|EmpTrueDate|',none,NULL|EmpHireDep|',none,''|EmpTitle|',none,''|IsTemp|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|") 分割出变量里的所有字段
MM_columns = Split(MM_columnsStr, "|") 分割出变量里的所有列
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 取得所有字段
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i))) 取得所有字段后面的value
Next
下面这段没看明白
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
基本上就是这些了
DW没用过,呵呵