DW+asp+access2010 insert record after the preview error

DW+asp+access2010 insert record after the preview error
Another page is the query log data, but normal
The page is inserted records.
Here is the code

<!--#include file="Connections/ceshi.asp" -->
<!--#include file="Connections/ceshi.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_ceshi_STRING
MM_editCmd.CommandText = "INSERT INTO ceshi (xm, mm) VALUES (?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("xm")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 255, Request.Form("mm")) ' adVarWChar

' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "lb.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
End If
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_ceshi_STRING
Recordset1_cmd.CommandText = "SELECT * FROM ceshi"
Recordset1_cmd.Prepared = true

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<form id="form1" name="form1" method="POST" action="<%=MM_editAction%>">
<table width="350" border="0">
<td width="114" height="30" align="right">Full name: </td>
<td width="220" height="30" align="left"><input type="text" name="xm" id="xm" /></td>
<td height="30" align="right">Cipher: </td>
<td height="30" align="left"><input type="text" name="mm" id="mm" /></td>
<td height="30" align="center">&nbsp;</td>
<td height="30" align="left"><input type="submit" name="button" id="button" value="Submit" /></td>
<input type="hidden" name="MM_insert" value="form1" />
Set Recordset1 = Nothing
All the teachers, to have a look, thanks.

Started by Spark at December 25, 2016 - 1:36 PM

Abstract to ask... Look a bit messy! The page name what is clearly written, form form to submit the page or a variable. .

Posted by Martha at January 04, 2017 - 2:10 PM

Hello, I use the operating system WIN764, in accordance with the method of the book the IIS is properly configured, and then use the DW CS5+ASP to do the procedure, connect the database, query the record set can be, is not inserted into the record, an insert preview is wrong, say what eighth for what MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)

Posted by Spark at January 09, 2017 - 2:58 PM