使用查询从表中删除行 [英] Deleting rows from a table using a query

查看:72
本文介绍了使用查询从表中删除行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




这些代码我可能真的很蠢。我正在开发一个小项目,其中最重要的事情之一就是从表中删除字段。所以我做的是写一个SQL查询并连接到窗体的命令按钮。但这必须只删除表的主键与用户在表单上的文本字段中输入的字段匹配的字段。我使用的SQL代码是


DELETE field1,field2,field3,.....

FROM< TableName>

WHERE field7 =< FormName>。< TextboxName>


但是代码似乎有问题。有人可以帮我这个


谢谢

解决方案


DELETE field1 ,field2,field3,.....

FROM< TableName>

WHERE field7 =< FormName>。< TextboxName>



尝试:

展开 | 选择 | Wrap | 行号


< blockquote class =post_quotes>
尝试:

展开 | 选择 | Wrap | 行号


不正确,不同查询类型将显示不同的图标。 ''x!''是删除查询图标。


如何在表单中运行查询?您应该使用:

展开 | 选择 | Wrap | 行号


Hi,

I am probably real dumb with these codes. I am working on a small project in which one of the most important things to be done is to delete fields from a table. So what i did was to write a SQL query and connect to a form''s command button. But this has to only delete fields where the table''s primary key matches with what the user enters in a text field on the form. The SQL code i used is

DELETE field1,field2,field3,.....
FROM <TableName>
WHERE field7=<FormName>.<TextboxName>

But there seems to be a problem with the code. Could someone help me with this

Thanks

解决方案

DELETE field1,field2,field3,.....
FROM <TableName>
WHERE field7=<FormName>.<TextboxName>

Try:

Expand|Select|Wrap|Line Numbers


Try:

Expand|Select|Wrap|Line Numbers


Nope that''s correct, different query types will show different icons. The ''x!'' is the delete query icon.

How are you running the query in your form? You should be using:

Expand|Select|Wrap|Line Numbers


这篇关于使用查询从表中删除行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆