数据库删除不成功,不懂得别进来!!高分!!

lzy5042 2001-08-02 09:33:40
z = "delete word from word,user_info where word.passwod='" & Text2.Text & "' and word.id = user_info.id "
w = "delete user_info from word,user_info where word.password='" & Text2.Text & "' and word.id =user_info.id"
DBopen.Execute w
DBopen.Execute z
程序执行后提示:specify the table containing the records you want to delete
翻译后:指定的表包含你想要删除的纪录“
为什么??清高手指点!!!谢谢!!
...全文
181 18 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzy5042 2001-08-02
  • 打赏
  • 举报
回复
哈!!!!!!!成功了!!!!!谢谢 ltpap(啊炮) 和cqq_chen(我是谁)
谢谢!!谢谢!!
lzy5042 2001-08-02
  • 打赏
  • 举报
回复
我再是一下,谢谢!!给分!!谢谢参与!!!
飞天神笔 2001-08-02
  • 打赏
  • 举报
回复
up
ty_cs 2001-08-02
  • 打赏
  • 举报
回复
我想提示的翻译:指定包含你想要删除记录的表

cqq_chen 2001-08-02
  • 打赏
  • 举报
回复
ltpao(啊炮)的做法是对的。
先删除USER_INFO的记录,后删除WORD的记录。
ltpao 2001-08-02
  • 打赏
  • 举报
回复
注意执行顺序
DBopen.Execute w
DBopen.Execute z
lzy5042 2001-08-02
  • 打赏
  • 举报
回复
还是不行!word表里的password被删除了。但是user_info表里的uername还没有删除
给分!谢谢你的参与!
ltpao 2001-08-02
  • 打赏
  • 举报
回复
z = "delete * from word where password='" & Text2.Text & "'"
w = "delete * from user_info where id in(select id from word where password='" & Text2.Text & "')"
lzy5042 2001-08-02
  • 打赏
  • 举报
回复
ltpao(啊炮):word表里的password被删除了。但是user_info表里的uername还没有删除!谢谢你的关心!谢谢!能在指点一下吗?
ltpao 2001-08-02
  • 打赏
  • 举报
回复
z = "delete * from word where password='" & Text2.Text & "' and id in (select id from user_info)"
w = "delete * from user_info where id=(select top 1 id from word where password='" & Text2.Text & "')"
lzy5042 2001-08-02
  • 打赏
  • 举报
回复
cqq_chen: word.id 和 user_info.id 都是编号,自动编号!为的是让两个表建立连接
lzy5042 2001-08-02
  • 打赏
  • 举报
回复
vb_suprot:程序出错!at most one record can be returned by this subquery
为什么??谢谢谢谢!!
cqq_chen 2001-08-02
  • 打赏
  • 举报
回复
可以说明一下word.id 和 user_info.id 的关系吗?
lzy5042 2001-08-02
  • 打赏
  • 举报
回复
wqb(啊喂)[table.*]是记录名
但是还是错
wqb 2001-08-02
  • 打赏
  • 举报
回复
DELETE [table.*] FROM table WHERE criteria
其中[table.*]应该是指记录名称吧,而你的语句中似乎是表名。
VB_support 2001-08-02
  • 打赏
  • 举报
回复
z="delete from word where word.password = '" & text2.text & "'
'上面的删除和外键有没有关系,或者和USER_INFO没有关系
有不是添加和修改,不需要判断的。
w = "delete from user_info where user_info.id = (select id from word where word.password='" & text2.text & "')
.
.
.
ltpao 2001-08-02
  • 打赏
  • 举报
回复
z = "delete word.* from word,user_info where word.passwod='" & Text2.Text & "' and word.id = user_info.id "
w = "delete user_info.* from word,user_info where word.password='" & Text2.Text & "' and word.id =user_info.id"
lzy5042 2001-08-02
  • 打赏
  • 举报
回复
谁来看一下?

1,217

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧