我用dw做的购物车页面,这是一个插入命令,但测试时,总提示insert into语法错误.
<%
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_conn_STRING
Command1.CommandText = "INSERT INTO tOrderDetail (fProductID) VALUES (" + Replace(Command1__strProductID, "'", "''") + ") "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
參考答案:Command1.CommandText = "INSERT INTO tOrderDetail (fProductID) VALUES (" + Replace(Command1__strProductID, "'", "''") + ") "
这一句改成
Command1.CommandText = "INSERT INTO tOrderDetail (fProductID) VALUES ('" + Replace(Command1__strProductID, "'", "''") + "') "