| 网站首页 | 业界新闻 | 群组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 编程论坛
大量收QQ微信精准粉/交友粉,非诚勿扰千里之行 始于足下
共有 576 人关注过本帖
标题:大婶们快来 - -求助啊。asp+access,插入记录、更新纪录。
只看楼主 加入收藏
saner
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-12-22
  问题点数:0  回复次数:0   
大婶们快来 - -求助啊。asp+access,插入记录、更新纪录。
用DW做asp+access
数据更新时:


Microsoft JET Database Engine 错误 '80040e10'
参数 ?_1 没有默认值。
/Admin/addgg.asp,行 36




36行为:
MM_editCmd.Execute
代码入下:


<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Connections/sjk.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_update")) = "form1") Then
If (Not MM_abortEdit) Then
' execute the update
Dim MM_editCmd


Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_sjk_STRING
MM_editCmd.CommandText = "UPDATE gonggao SET neirong = ? WHERE ID = ?"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("elm1")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 5, 1, -1, MM_IIF(Request.Form("MM_recordId"), Request.Form("MM_recordId"), null)) ' adDouble
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
End If
End If
%>
<%
Dim gongg
Dim gongg_cmd
Dim gongg_numRows


Set gongg_cmd = Server.CreateObject ("ADODB.Command")
gongg_cmd.ActiveConnection = MM_sjk_STRING
gongg_cmd.CommandText = "SELECT * FROM gonggao ORDER BY ID ASC"
gongg_cmd.Prepared = true


Set gongg = gongg_cmd.Execute
gongg_numRows = 0
%>
<!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>


<script type="text/javascript" src="xheditor-1.1.14/jquery/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/xhEditor/xheditor-1.1.14-zh-cn.min.js"></script>
<script type="text/javascript">
$(pageInit);
function pageInit()
{
$('#elm1').xheditor({upLinkUrl:"upload.asp",upLinkExt:"zip,rar,txt",upImgUrl:"upload.asp",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"upload.asp",upFlashExt:"swf",upMediaUrl:"upload.asp",upMediaExt:"wmv,avi,wma,mp3,mid",shortcuts:{'ctrl+enter':submitForm}});
}
function insertUpload(arrMsg)
{
var i,msg;
for(i=0;i<arrMsg.length;i++)
{
msg=arrMsg[i];
$("#uploadList").append('<option value="'+msg.id+'">'+msg.localname+'</option>');
}
}
function submitForm(){$('#frmDemo').submit();}
</script>




<link href="../css/style.css" rel="stylesheet" type="text/css" />






</head>


<body>


<div id="ht">
<div class="ht_mtop1">
<div class="ht_tt1">当前位置:首 页 >>后台>>公告管理>>添加公告</div>
</div>


<form ACTION="<%=MM_editAction%>" METHOD="POST" id="form1" name="form1" >
<table width="100%" cellspacing="0" cellpadding="0" border="1" bordercolor=" #88d8ff">
<tr>
<td height="82" colspan="2"><div align="center">添加-网站公告</div></td>
</tr>
<tr>
<td height="312" width="15%">内容:</td>
<td width="85%" align="left"><label>
<textarea id="elm1" runat="server" name="txtContent" rows="18" cols="80" style="width: 100%"><%=(gongg.Fields.Item("neirong").Value)%></textarea>
</label></td>
</tr>
<tr>
<td height="69" colspan="2" align="center"><label>
<input type="submit" name="发布" id="发布" value="发布" />
&nbsp; &nbsp; &nbsp; </label>
<label>
<input type="reset" name="重置" id="重置" value="重置" />
</label></td>
</tr>
</table>



<input type="hidden" name="MM_update" value="form1" />
<input type="hidden" name="MM_recordId" value="<%= gongg.Fields.Item("ID").Value %>" />
</form>
</div>
</body>
</html>
<%
gongg.Close()
Set gongg = Nothing
%>








_______________________________________________________-
第二个问题。
用DW做asp+access
数据插入时:


Microsoft JET Database Engine 错误 '80040e14'
INSERT INTO 语句的语法错误。
/Admin/addgly.asp,行 26
26行同样为:
MM_editCmd.Execute
代码入下:




<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Connections/sjk.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
%>
<%
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_sjk_STRING
MM_editCmd.CommandText = "INSERT INTO [admin] (username, password) VALUES (?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 201, 1, 50, Request.Form("username")) ' adLongVarChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 201, 1, 50, Request.Form("password")) ' adLongVarChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
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>
<link href="../css/style.css" rel="stylesheet" type="text/css" />


</head>


<body>


<div id="ht">
<div class="ht_mtop1">
<div class="ht_tt1">当前位置:首 页 >> 后台>> 管理员管理>> 添加管理员</div>
</div>
<form ACTION="<%=MM_editAction%>" METHOD="POST" id="form1" name="form1" >
<table width="100%" cellspacing="0" cellpadding="0" border="1" bordercolor=" #88d8ff">
<tr>
<td height="30" colspan="2"><div align="center">添加-管理员</div></td>
</tr>
<tr>
<td width="27%" height="54">用户名:</td>
<td width="73%" align="center"><label> <input name="username" id="username" type="text" size="50" /></label></td>
</tr>
<tr>
<td height="53">密码:</td>
<td align="center"><label>
<input type="text" name="password" id="password" size="50" />
</label></td>
</tr>

<tr>
<td align="center" colspan="2"><label>
<input type="submit" name="发布" id="发布" value="添加" />
&nbsp; &nbsp; &nbsp; </label>
<label>
<input type="reset" name="重置" id="重置" value="重置" />
</label></td>
</tr>
</table>



<input type="hidden" name="MM_insert" value="form1" />
</form>
</div>
</body>
</html>


小弟万分感谢!!!
搜索更多相关主题的帖子: Microsoft  include  记录  file  
2013-12-22 13:32







关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020329 second(s), 7 queries.
Copyright©2004-2018, BCCN.NET, All Rights Reserved