尝试使用visual studio更新asp中的访问数据库。
Dim accessDatabase2 As New AccessDataSource
accessDatabase2 = New AccessDataSource("Prestiege.accdb", "SELECT * FROM Rooms ;")
accessDatabase2.UpdateCommand = "UPDATE [Rooms] SET [Occupancy] = 1 Where [RoomType] = Single ;"
accessDatabase2.Update()
如果我删除 where condition ,它可以正常工作。否则我会收到此错误:
Exception Details: System.Data.OleDb.OleDbException: No value given for one or more required parameters.
任何人都可以帮我吗?
答案 0 :(得分:1)
在给出字符串参数
时尝试使用单引号accessDatabase2.UpdateCommand = "UPDATE [Rooms] SET [Occupancy] = 1 Where [RoomType] = 'Single';"