这是我的最后一个毕业项目,我坚持这个。使用:
- ASP.NET 2010
- 微软访问 2007
我检查了注册表和它的罚款。插入正在其他地方工作。
有人可以帮忙吗?
Public Sub insertreply()
Dim con1 As New OleDbConnection
con1.ConnectionString = constr
Dim cmd As New OleDbCommand
Dim strsql As String
con1.Open()
cmd.Connection = con1
strsql = "Insert Into replyblog("
strsql &= "repliername"
strsql &= ",replierprofilepicture"
strsql &= ",replierreply"
strsql &= ",replieruniversity"
strsql &= ",repliertoid"
strsql &= ",replierid"
strsql &= ",replierthanks"
strsql &= ",repliermajor"
strsql &= ",repliergrad"
strsql &= ",replierthanked) "
strsql &= "Values("
strsql &= "@repliername"
strsql &= ",@replierprofilepicture"
strsql &= ",@replierreply"
strsql &= ",@replieruniversity"
strsql &= ",@repliertoid"
strsql &= ",@replierid"
strsql &= ",@replierthanks"
strsql &= ",@repliermajor"
strsql &= ",@repliergrad"
strsql &= ",@replierthanked)"
cmd.CommandText = strsql
cmd.Parameters.AddWithValue("@repliername", lblrepliernamen.Text)
cmd.Parameters.AddWithValue("@replierprofilepicture", lblreplierpicn.text)
cmd.Parameters.AddWithValue("@replierreply", tbxinfo.Text)
cmd.Parameters.AddWithValue("@replieruniversity", lblreplieruniversityn.text)
cmd.Parameters.AddWithValue("@repliertoid", Session("QuestID"))
cmd.Parameters.AddWithValue("@replierid", lblreplieridn.Text)
cmd.Parameters.AddWithValue("@replierthanks", lblreplierthanksn.Text)
cmd.Parameters.AddWithValue("@repliermajor", lblrepliermajorn)
cmd.Parameters.AddWithValue("@repliergrad", lblrepliergradn.text)
cmd.Parameters.AddWithValue("@replierthanked", "n")
cmd.ExecuteNonQuery()
con1.Close()
End Sub
我有错误cmd.executeNonQuery()
多步 OLE DB 操作产生错误。检查每个 OLE DB 状态值(如果可用)。没有做任何工作。