如何从Access DataBase中删除DataRow。 [英] How to delete DataRow from access DataBase.
本文介绍了如何从Access DataBase中删除DataRow。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用窗口管理管理员登录。
我希望最多5次注册,第6次注册会从数据库中删除第1个DataRow。
Working on a window to manage admin logins.
I want a maximum of 5 signup in a way that the 6th one deletes the 1st DataRow from the DataBase.
query = "delete * from adminTable";
清除DataBase中的所有行。
Is clearring all the rows from DataBase.
While
query = "delete * from adminTable where [USER NAMES] = 'singal' ";
清楚我指定的行。
但是我想要第一行,无论如何,只是被删除。
请帮助,谢谢。
Is clearring the row I've specified.
But I want the 1st row only, no matter what, to just get deleted.
Help please, thanks.
推荐答案
请尝试以下方法:
Try the following:
DELETE FROM (SELECT TOP 1 * FROM adminTable)
MSAccess语法有点奇怪
另一个如果哟你有一个自动编号ID字段
MSAccess syntax is a little strange
An alternative if you have an AutoNumber ID field
DELETE FROM adminTable where ID = (SELECT MIN(ID) From adminTable)
但这不是多方面的好习惯 - 用户环境
but this is not good practice in multi-user environments
这篇关于如何从Access DataBase中删除DataRow。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文