我是用dreamweaver8写一个简单的留言页面,语言设定的javascript.但是运行后总是出错,错误提示如下:--------------------------------------------------------------------------------
HTTP 错误 500.100 - 内部服务器错误 - ASP 错误
Internet 信息服务错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。
/refer.asp, 第 78 行网页:
POST 89 ??? /refer.aspPOST Data:
name=adsf&lianxi=asdfasd&qq=adsf&email=asdf&text=asdf&enter=%CC%E1%BD%BB&MM_insert=liuyan  
--------------------------------------------------------------------------------
*************页面代码如下,我不知道错在哪儿?请高手帮忙诊断一下:***********************
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!--#include virtual="/Connections/datelink.asp" -->
<%
// *** Edit Operations: declare variables// set the form action variable
var MM_editAction = Request.ServerVariables("SCRIPT_NAME");
if (Request.QueryString) {
  MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
}// boolean to abort record edit
var MM_abortEdit = false;// query string to execute
var MM_editQuery = "";
%>
<%
// *** Insert Record: set variablesif (String(Request("MM_insert")) == "liuyan") {  var MM_editConnection = MM_datelink_STRING;
  var MM_editTable = "liuyan";
  var MM_editRedirectUrl = "/referok.asp";
  var MM_fieldsStr = "name|value|lianxi|value|qq|value|email|value|text|value";
  var MM_columnsStr = "name|',none,''|phone|',none,''|QQ|',none,''|E-mail|',none,''|word|',none,''";  // create the MM_fields and MM_columns arrays
  var MM_fields = MM_fieldsStr.split("|");
  var MM_columns = MM_columnsStr.split("|");
   
  // set the form values
  for (var i=0; i+1 < MM_fields.length; i+=2) {
  MM_fields[i+1] = String(Request.Form(MM_fields[i]));
  }  // append the query string to the redirect URL
  if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) {
  MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&") + Request.QueryString;
  }
}
%>
<%
// *** Insert Record: construct a sql insert statement and execute itif (String(Request("MM_insert")) != "undefined") {  // create the sql insert statement
  var MM_tableValues = "", MM_dbValues = "";
  for (var i=0; i+1 < MM_fields.length; i+=2) {
  var formVal = MM_fields[i+1];
  var MM_typesArray = MM_columns[i+1].split(",");
  var delim = (MM_typesArray[0] != "none") ? MM_typesArray[0] : "";
  var altVal = (MM_typesArray[1] != "none") ? MM_typesArray[1] : "";
  var emptyVal = (MM_typesArray[2] != "none") ? MM_typesArray[2] : "";
  if (formVal == "" || formVal == "undefined") {
  formVal = emptyVal;
  } else {
  if (altVal != "") {
  formVal = altVal;
  } else if (delim == "'") { // escape quotes
  formVal = "'" + formVal.replace(/'/g,"''") + "'";
  } else {
  formVal = delim + formVal + delim;
  }
  }
  MM_tableValues += ((i != 0) ? "," : "") + MM_columns[i];
  MM_dbValues += ((i != 0) ? "," : "") + formVal;
  }
  MM_editQuery = "insert into " + MM_editTable + " (" + MM_tableValues + ") values (" + MM_dbValues + ")";  if (!MM_abortEdit) {
  // execute the insert
  var MM_editCmd = Server.CreateObject('ADODB.Command');
  MM_editCmd.ActiveConnection = MM_editConnection;
  MM_editCmd.CommandText = MM_editQuery;
  MM_editCmd.Execute();============================>>>****************这就是第78行************
  MM_editCmd.ActiveConnection.Close();  if (MM_editRedirectUrl) {
  Response.Redirect(MM_editRedirectUrl);
  }
  }}
%>--------------------------------------------------------------------------------
表单内内容如下:
--------------------------------------------------------------------------------
  <div align="center">
  <form ACTION="<%=MM_editAction%>" METHOD="POST" name="liuyan">您的姓名:<input name="name" type="text" />       您的联系方式:<input name="lianxi" type="text" /><p>
您的 QQ : <input name="qq" type="text" />       您的电子邮箱:<input name="email" type="text" /><p>
<textarea name="text" cols="75" rows="10"></textarea><p>
<input name="quxiao" type="reset" value="重置" />       
  <input name="enter" type="submit" value="提交" />
  <input type="hidden" name="MM_insert" value="liuyan">
</form>   
  </div>-----------------------------------------------------------------------------------------
请高手帮我解决一下!!!
-----------------------------------------------------------------------------------------

解决方案 »

  1.   

    什么sql打了来看看?怎么打?
      

  2.   

    INSERT INTO 语句的语法错误。sql 语句写的有问题。
    --定义一个表
    declare @table table (id int ,pid int ,saleid int)
    --插入数据
    insert into @table
    select 1,0,4 union all
    select 2,1,5 union all
    select 3,1,6 union all
    select 4,2,7 union all
    select 5,3,8 union all
    select 6,4,9 union all
    select 7,5,10 union all
    select 8,0,11
    --查询表数据
    select * from @table
    /*
    id          pid         saleid
    ----------- ----------- -----------
    1           0           4
    2           1           5
    3           1           6
    4           2           7
    5           3           8
    6           4           9
    7           5           10
    8           0           11
    */
      

  3.   

     MM_editQuery   的值是什么 显示出来看看 
      

  4.   

    代码都在上面了。我是菜鸟级的。可以不可在上面贴出的代码中看出点什么?我用的是ACCESS数据库。
      

  5.   


    var MM_editQuery = "";
    %>
    <%
      

  6.   

    Insert Into TableName (字段名字1,字段名字2) Values('字符类型的值1',数字类型的值2)字符类型,日期类型等都要加'