标题:[求助] insert into 语句的语法错误.....
取消只看楼主
pearzxf
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2007-1-9
 问题点数:0 回复次数:0 
[求助] insert into 语句的语法错误.....



用户注册资料填完,左上方就出现


到底哪个地方有问题啦~~

If Page.IsValid Then
Try
Dim con As New OleDbConnection
con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("../fdkasasdka/database/yonghuzhuce.mdb")
Dim cmd As New OleDbCommand
cmd.CommandText = "insert into person(id,password,name,sex,birthdate,zjhm,email,address) values (@id,@password,@name,@sex,@birthdate,@zjhm,@email,@address)"
cmd.Parameters.Add(New OleDbParameter("@id", OleDbType.VarChar))
cmd.Parameters("@id").Value = TextBox1.Text
cmd.Parameters.Add(New OleDbParameter("@password", OleDbType.VarChar))
cmd.Parameters("@password").Value = TextBox2.Text
cmd.Parameters.Add(New OleDbParameter("@name", OleDbType.VarChar))
cmd.Parameters("@name").Value = TextBox4.Text
cmd.Parameters.Add(New OleDbParameter("@sex", OleDbType.VarChar))
cmd.Parameters("@sex").Value = RadioButton1.Text
cmd.Parameters("@sex").Value = RadioButton2.Text
cmd.Parameters.Add(New OleDbParameter("@birthday", OleDbType.Date))
cmd.Parameters("@birthday").Value = TextBox5.Text
cmd.Parameters.Add(New OleDbParameter("@zjhm", OleDbType.VarChar))
cmd.Parameters("@zjhm").Value = TextBox6.Text
cmd.Parameters.Add(New OleDbParameter("@email", OleDbType.VarChar))
cmd.Parameters("@email").Value = TextBox7.Text
cmd.Parameters.Add(New OleDbParameter("@address", OleDbType.VarChar))
cmd.Parameters("@address").Value = TextBox8.Text
cmd.Connection = con
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Catch ex As Exception
Response.Write(ex.Message)
End Try
End If
搜索更多相关主题的帖子: insert 语法 语句 
2007-06-16 14:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-147991-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.456076 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved