主题:INSERT INTO 语句的语法错误
我在做ASP.NET网页时,输入以下代码:<script language="vb" runat="server">
Sub clickevent(sender As system.Object, E As system.eventArgs)
dim strconn as string="provider=microsoft.jet.oledb.4.0;data source="& server.mappath("max\regedit.mdb")
dim objconn as new system.data.oledb.oledbconnection(strconn)
dim strsql as string="insert into user(username,password,email,realname,bodynum,phono) values('"& txtname.text &"','"& txtpwd.text &"','"& txtemail.text &"','"& txtrea.text &"','"& txtnum.text &"',''"&txtpho.text &")"
dim objcomm as new system.data.oledb.oledbcommand(strsql,objconn)
objconn.open()
objcomm.executenonquery
End Sub
</script>
IE中老是显示如下的错误信息:请问是什么问题呀
Server Error in '/' Application.
-----------------------------------------------------------------------------
INSERT INTO 语句的语法错误。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: INSERT INTO 语句的语法错误。
Sub clickevent(sender As system.Object, E As system.eventArgs)
dim strconn as string="provider=microsoft.jet.oledb.4.0;data source="& server.mappath("max\regedit.mdb")
dim objconn as new system.data.oledb.oledbconnection(strconn)
dim strsql as string="insert into user(username,password,email,realname,bodynum,phono) values('"& txtname.text &"','"& txtpwd.text &"','"& txtemail.text &"','"& txtrea.text &"','"& txtnum.text &"',''"&txtpho.text &")"
dim objcomm as new system.data.oledb.oledbcommand(strsql,objconn)
objconn.open()
objcomm.executenonquery
End Sub
</script>
IE中老是显示如下的错误信息:请问是什么问题呀
Server Error in '/' Application.
-----------------------------------------------------------------------------
INSERT INTO 语句的语法错误。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: INSERT INTO 语句的语法错误。