INSERT INTO 语句的语法错误。 25
<%sql="insertintonamesfz(gbname,SFZID,PassWord,xm,jg)values('"&gbname&"',"&SFZID&","&...
<%
sql="insert into namesfz (gbname,SFZID,PassWord,xm,jg) values('"&gbname&"',"&SFZID&","&PassWord&",'"&xm&"','"&jg&"')"
conn.execute(sql)
i=i+1
xlsrs.MoveNext
Loop
response.write "</table>"
End If
xlsrs.close
Response.write "共导入<font color='red'>" & i-1 & "</font>条记录.<br>" & vbCrLf
set xlsconn=nothing
set objCmd=nothing
%>
提示
错误类型:
Microsoft JET Database Engine (0x80040E14)
INSERT INTO 语句的语法错误。
/up.asp, 第 50 行
50行内容是:
conn.execute(sql)
请大家帮忙,就20分了!
回复chiconysun:
gbname 姓名(中文)
SFZID 代码(数字)
PassWord 密码(密码当然是数字或者英文都有了)
xm 积分 (数字)
jg 类型 (中文)
=================================
回复krnvta
错误类型:
Microsoft VBScript 编译器错误 (0x800A03EE)
缺少 ')'
/ceshi.asp, line 4, column 33
if (String(Request("MM_insert")) != "undefined") {
--------------------------------^
浏览器类型:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)
如果把conn.execute(sql)这个语句去掉的话可以显示.但是存储不到数据库里! 展开
sql="insert into namesfz (gbname,SFZID,PassWord,xm,jg) values('"&gbname&"',"&SFZID&","&PassWord&",'"&xm&"','"&jg&"')"
conn.execute(sql)
i=i+1
xlsrs.MoveNext
Loop
response.write "</table>"
End If
xlsrs.close
Response.write "共导入<font color='red'>" & i-1 & "</font>条记录.<br>" & vbCrLf
set xlsconn=nothing
set objCmd=nothing
%>
提示
错误类型:
Microsoft JET Database Engine (0x80040E14)
INSERT INTO 语句的语法错误。
/up.asp, 第 50 行
50行内容是:
conn.execute(sql)
请大家帮忙,就20分了!
回复chiconysun:
gbname 姓名(中文)
SFZID 代码(数字)
PassWord 密码(密码当然是数字或者英文都有了)
xm 积分 (数字)
jg 类型 (中文)
=================================
回复krnvta
错误类型:
Microsoft VBScript 编译器错误 (0x800A03EE)
缺少 ')'
/ceshi.asp, line 4, column 33
if (String(Request("MM_insert")) != "undefined") {
--------------------------------^
浏览器类型:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)
如果把conn.execute(sql)这个语句去掉的话可以显示.但是存储不到数据库里! 展开
展开全部
<%
// *** Insert Record: construct a sql insert statement and execute it
if (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;
response.write MM_editQuery
response.end()
MM_editCmd.Execute();
MM_editCmd.ActiveConnection.Close();
if (MM_editRedirectUrl) {
Response.Redirect(MM_editRedirectUrl);
}
}
}
%>
<%
var RecordsetCDB = Server.CreateObject("ADODB.Recordset");
RecordsetCDB.ActiveConnection = MM_ConnCDB_STRING;
RecordsetCDB.Source = "SELECT * FROM [Database]";
RecordsetCDB.CursorType = 0;
RecordsetCDB.CursorLocation = 2;
RecordsetCDB.LockType = 1;
RecordsetCDB.Open();
var RecordsetCDB_numRows = 0;
%>
把这个页面的执行结果贴出来。
// *** Insert Record: construct a sql insert statement and execute it
if (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;
response.write MM_editQuery
response.end()
MM_editCmd.Execute();
MM_editCmd.ActiveConnection.Close();
if (MM_editRedirectUrl) {
Response.Redirect(MM_editRedirectUrl);
}
}
}
%>
<%
var RecordsetCDB = Server.CreateObject("ADODB.Recordset");
RecordsetCDB.ActiveConnection = MM_ConnCDB_STRING;
RecordsetCDB.Source = "SELECT * FROM [Database]";
RecordsetCDB.CursorType = 0;
RecordsetCDB.CursorLocation = 2;
RecordsetCDB.LockType = 1;
RecordsetCDB.Open();
var RecordsetCDB_numRows = 0;
%>
把这个页面的执行结果贴出来。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询