在VB实现更新数据时显示缺少语句结束

img

If cnn.State = 0 Then
    cnn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=KFC;Data Source=."
    cnn.Open
End If

Set rst = New ADODB.Recordset
sql ="update DISH set DPrice='"&Text1.text&"'where DISH_ID="+ Label4.Caption
rst.Open sql, cnn, adOpenKeyset, adLockBatchOptimistic
MsgBox "修改成功"


End Sub

菩薩慈悲:where 前面空個半形空格試試吧。→「'where」→「' where」。您這樣寫,「where」就和 「'」連在一塊了!感恩感恩 南無阿彌陀佛