MM_editCmd.Execute 出錯

lkc1620 2008-11-30 09:57:31
我是新手 完全跟隨書本做的加入會員系統 卻總是出錯

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/connMember.asp" -->
<%
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_connMember_STRING
MM_editCmd.CommandText = "INSERT INTO memberdata (m_id, m_pw, m_name, m_class, m_classno, m_sex, m_birthday, m_phone, m_parphone, m_level) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 8, Request.Form("m_id")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 50, Request.Form("m_pw")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 50, Request.Form("m_name")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 2, Request.Form("m_class")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 2, Request.Form("m_classno")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202, 1, 1, Request.Form("m_sex")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 135, 1, -1, MM_IIF(Request.Form("m_birthday"), Request.Form("m_birthday"), null)) ' adDBTimeStamp
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 202, 1, 8, Request.Form("m_phone")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param9", 202, 1, 8, Request.Form("m_parphone")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param10", 202, 1, 1, Request.Form("m_level")) ' adVarWChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "memberaddsuccess.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
Response.Redirect(MM_editRedirectUrl)
End If
End If
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
left:86px;
top:43px;
width:423px;
height:418px;
z-index:1;
}
.style13 {font-family: Arial, Helvetica, sans-serif}
.style15 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; font-size: 14px; }
.style17 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
#apDiv2 {
position:absolute;
left:102px;
top:11px;
width:565px;
height:0px;
z-index:1;
}
-->
</style>
</head>

<body>
<div id="apDiv2">
<form id="form1" name="form1" method="POST" action="<%=MM_editAction%>">
<table width="395" height="357" border="1" cellspacing="0" bordercolor="#BFCCFF">
<tr>
<td width="171" height="23" bgcolor="#000066"><span class="style15"> User ID:</span></td>
<td width="214"><span class="style17">
<label>
<input name="m_id" type="text" id="m_id" />
*<br />
Student card number</label>
</span></td>
</tr>
<tr>
<td bgcolor="#000066"><span class="style15">Password:</span></td>
<td><span class="style17">
<label>
<input type="text" name="m_pw" id="m_pw" />
*<br />
Student's ID number</label>
</span></td>
</tr>
<tr>
<td bgcolor="#000066"><span class="style15">Name:</span></td>
<td><span class="style17">
<label>
<input type="text" name="m_name" id="m_name" />
*</label>
</span></td>
</tr>
<tr>
<td bgcolor="#000066"><span class="style15">Class:</span></td>
<td><span class="style17">
<label>
<input type="text" name="m_class" id="m_class" />
*</label>
</span></td>
</tr>
<tr>
<td bgcolor="#000066"><span class="style15">Class number:</span></td>
<td><span class="style17">
<label>
<input type="text" name="m_classno" id="m_classno" />
*</label>
</span></td>
</tr>
<tr>
<td bgcolor="#000066"><span class="style15">Gender:</span></td>
<td><span class="style17">
<label>
<input <%If (CStr("F") = CStr("m_sex")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="radio" name="m_sex" id="m_sex" value="F" />
F
<input type="radio" name="m_sex" id="m_sex2" value="M" />
M*</label>
</span></td>
</tr>
<tr>
<td bgcolor="#000066"><span class="style15">Birthday</span></td>
<td><span class="style17">
<label>
<input type="text" name="m_birthday" id="m_birthday" />
* <br />
yyyy/mm/dd</label>
</span></td>
</tr>
<tr>
<td bgcolor="#000066"><span class="style15">Phone number:</span></td>
<td><span class="style17">
<label>
<input type="text" name="m_phone" id="m_phone" />
*</label>
</span></td>
</tr>
<tr>
<td bgcolor="#000066"><span class="style15">Parent's phone number:</span></td>
<td><span class="style17">
<label>
<input type="text" name="m_parphone" id="m_parphone" />
</label>
</span></td>
</tr>
<tr>
<td height="37" bgcolor="#000066"><span class="style15">Level</span></td>
<td><span class="style17">
<select name="m_level" id="m_level">
<option value="A">Admin</option>
<option value="U">User</option>
</select>
*</span></td>
</tr>
<tr>
<td colspan="2" bgcolor="#CCCCCC"><span class="style18">
<label> </label>
</span>
<div align="center" class="style17"> <span class="style18">
<input name="addmember" type="submit" class="style13" id="addmember" value="Add member" />
<input name="reset" type="reset" class="style13" id="reset" value="Reset" />
</span></div>
<span class="style18"> </span></td>
</tr>
</table>

<input type="hidden" name="MM_insert" value="form1" />
</form>
</div>
</body>
</html>
...全文
1682 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
内容概要:本文围绕基于CNN-BiLSTM-Attention混合神经网络模型的电力负荷预测展开研究,提出一种结合卷积神经网络(CNN)、双向长短期记忆网络(BiLSTM)与注意力机制(Attention)的深度学习框架,并通过Python代码实现高精度的短期与超短期负荷预测。该模型充分利用CNN对局部特征的提取能力,捕捉负荷数据中的周期性与趋势性模式;借助BiLSTM对时间序列前后向依赖关系的建模能力,增强对动态变化的感知;并通过Attention机制自适应地聚焦关键历史时刻,提升预测准确性。文中详细阐述了数据预处理、模型结构设计、训练流程及超参数调优方法,并在真实负荷数据集上进行了实验验证,结果表明该混合模型相比传统单一模型和其他基准模型具有更优的预测性能,尤其在应对非线性、非平稳负荷波动方面表现突出。; 适合人群:具备一定Python编程能力和机器学习基础,从事电力系统分析、能源管理、智能电网或时序预测相关工作的科研人员、工程师及高校研究生。; 使用场景及目标:①应用于电网调度、电力市场出清、需求响应管理等场景下的精细化负荷预测;②为研究人员提供一套完整的、可复现的深度学习负荷预测代码框架,推动AI技术在能源领域的落地应用;③帮助理解CNN、BiLSTM与Attention模块之间的协同机制及其在时序建模中的集成方式。; 阅读建议:建议读者结合所提供的Python代码进行动手实践,重点掌握数据归一化、滑动窗口构造、模型搭建与训练技巧,并尝试在不同地区、不同季节的负荷数据上进行迁移测试,以深入理解模型泛化能力与调参策略。
内容概要:本文围绕“MATLAB具有储能的经济调度及机会约束和鲁棒优化”展开,系统研究了电力系统中融合储能技术的经济调度问题,重点探讨了机会约束规划与鲁棒优化方法在应对新能源出力不确定性、负荷波动及系统运行风险中的应用。内容涵盖风光储协同调度、多微网共享储能、电动汽车参与调度、低碳经济调度等多种典型场景,深入分析了储能的选址定容、功率协调控制、状态估计与优化调度模型。核心技术包括粒子群优化(PSO)、分布鲁棒机会约束(DRCC)、模型预测控制(MPC)、鲁棒优化、二阶锥规划(SOCP)等先进算法,并提供了基于Matlab/Simulink的完整仿真代码实现,旨在提升新型电力系统的运行灵活性、经济性与抗风险能力。; 适合人群:具备电力系统、自动化、电气工程或相关专业背景,熟悉Matlab/Simulink仿真环境与基本优化算法,从事新能源并网、微电网运行、储能系统规划、电力市场调度等领域的研究生、科研人员及工程技术人员。; 使用场景及目标:① 学习并构建含储能的电力系统经济调度优化模型;② 掌握机会约束与鲁棒优化在处理新能源不确定性问题中的建模思路与求解方法;③ 利用提供的Matlab代码进行算法复现、仿真验证与性能对比,支撑科研项目攻关;④ 为撰写高水平学术论文、学位论文或工程优化方案提供可靠的模型参考与代码支持。; 阅读建议:建议读者结合文档中具体的案例(如风电-水电联合调度、电动汽车集群调度、多微网共享储能等)和配套的Matlab代码进行动手实践,重点关注优化模型的构建逻辑、约束条件设定与求解器配置过程,同时可关注公众号“荔枝科研社”获取完整资源包、复现教程及持续的技术支持。

28,402

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧