【问题标题】:How to perform an SQL update using TADOCommand? [closed]如何使用 TADOCommand 执行 SQL 更新? [关闭]
【发布时间】:2021-06-04 00:35:33
【问题描述】:

我想使用TDataModule 上的TADOCommand 创建一个更新按钮,但此代码不起作用。有谁知道正确的代码是什么?

【问题讨论】:

  • 究竟什么对你“不起作用”?您是否收到编译器错误?运行时错误?注意数据库中的更新?请更具体。
  • 更新查询出错,我不知道如何编写正确的更新查询。那“更新 elektronik set ... where ... 是错误。如何在 delphi 7 中编辑具有多个字段的表?
  • Please do not upload images of code/errors when asking a question.。代码是文本,可以直接复制粘贴到您的帖子中。此外,doesn't work 作为问题描述毫无意义。具体在什么情况下不起作用?
  • 哦,是的,我刚刚发现了问题。非常感谢!!

标签: crud delphi-7 ado


【解决方案1】:

您的 SQL 格式错误,因为您在字段之间缺少逗号:

UPDATE Elektronik SET Nama_Barang = :Nama_Barang, Harga = :Harga, Stok = :Stok WHERE ID = :ID

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-22
    • 1970-01-01
    • 2012-12-16
    • 1970-01-01
    • 1970-01-01
    • 2022-10-05
    • 1970-01-01
    • 2011-12-31
    相关资源
    最近更新 更多