更新时间:2023-09-20 14:55:52
您没有提供上述代码的错误信息。所以,我只能猜测...... MS Access数据库引擎不知道Double
数据类型 [ ^ ]。您应该设置正确的数据类型,例如NUMERIC
或MONEY
您的代码很危险,因为 SQL Injection [ ^ 。我不建议通过代码修改表格!想象一下,当用户进入UpdateTextBox
文本时会发生什么:DELETE FixedAssets
......
使用参数化查询代替!
如需了解更多信息,请参阅:
ALTER TABLE(MS Access) [ ^ ]
SQL注入以及如何避免它[ ^ ]
You did not provide information what's wrong with above code. So, i can only guess that... MS Access database engine does not knowDouble
data type[^]. You should set proper data type, such asNUMERIC
orMONEY
Your code is dangerous, because is open for SQL Injection[^]. I do no recommend to modify tables via code! Imagine, what happen when user enter intoUpdateTextBox
text like this: "DELETE FixedAssets
"...
Use parametrized queries instead!
For further information, please see:
ALTER TABLE (MS Access)[^]
SQL Injection and how to avoid it[^]