insertinto语句的语法错误,insert语句报错

http://www.itjxue.com  2023-01-04 15:45  来源:未知  点击次数: 

INSERT INTO 语句的语法错误

sql="Insert Into index (number,username,xingbie,shengri) values('"number"','"username"','"xingbie"',#"date"#)"

index(number这里加个空格,还有如果number,username,xingbie,shengri中有数值型字段的话,后面就不要用"'"

INSERT INTO 语句语法错误??

"我也试过,插入语句格式是正确的(因为是从另外一个能运行的程序拷过来的),在放在我的文件中就说“INSERT INTO 语句的语法错误”

但后来解决了,方法是将表和字段名都加上中括号":摘自网上的。希望对你有帮助

INSERT INTO 语句的语法错误?

insert into当中多了into,弃掉into就可以了。

因为insert是及物动词,直接接宾语,不需要介词。

INSERT INTO 语句的语法错误。

给Note加上[Note] 试试,有可能Note是保留字段,另外就是检查一下Note字段是否是字符型

Insert into 语句语法错误

%

// *** 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;

%

把这个页面的执行结果贴出来。

(责任编辑:IT教学网)

更多