一个很简单的问题数据库问题。

wgal 2001-12-18 11:53:00
部门名称 姓名
设备科 萧萧

表格中的数据是从三个表中读出来的,部门名称从table1,姓名从table2,其中table3中有部门的编码,和姓名编码;table2中有姓名和姓名编码;table1中有部门和部门编码。
...全文
141 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
lazywolf 2001-12-19
  • 打赏
  • 举报
回复
点击“管理”
lazywolf 2001-12-18
  • 打赏
  • 举报
回复
select table1. 部门名称,table2.姓名 from table1 inner join table2 inner join table3 where table3.部门编码=table1.部门编码 and table1.姓名编码=table3.姓名编码
chenxuqian 2001-12-18
  • 打赏
  • 举报
回复
select 部门名称,姓名 from table1,table2,table3
where table1.部门的编码=table3.部门的编码 and table2.姓名编码=table3.姓名编码
longj 2001-12-18
  • 打赏
  • 举报
回复
select table1.depname,table2.username from table1,table2,table3
where table1.depid = table3.depid and table2.userid = table3.userid
wgal 2001-12-18
  • 打赏
  • 举报
回复
我的问题解决了可是我不知道怎么给大家加分
wgal 2001-12-18
  • 打赏
  • 举报
回复
wgal 2001-12-18
  • 打赏
  • 举报
回复
谢谢大家·
lazywolf 2001-12-18
  • 打赏
  • 举报
回复
加这个试试:rs.CursorLocation=3
wgal 2001-12-18
  • 打赏
  • 举报
回复
我写了select table1.depname,table2.username from table1,table2,table3
where table1.depid = table3.depid and table2.userid = table3.userid and table2.marker='a'之后
count=rs.recordcount统计出来的count不对是-1 但有记录显示
我是用rs.open sql,conn,1,1 方式打开的

而我用select * from tabel2 where marker='a'
count的值是对的
(说明一下两种select方法count结果应该是一样的)
wgal 2001-12-18
  • 打赏
  • 举报
回复
我写了select table1.depname,table2.username from table1,table2,table3
where table1.depid = table3.depid and table2.userid = table3.userid 之后
count=rs.recordcount统计出来的count不对是-1

我是用rs.open sql,conn,1,1 方式打开的
wgal 2001-12-18
  • 打赏
  • 举报
回复
我写了select table1.depname,table2.username from table1,table2,table3
where table1.depid = table3.depid and table2.userid = table3.userid 之后
count=rs.recordcount统计出来的count不对是-1

我是用rs.open sql,conn,1,1 方式打开的
BrightEye 2001-12-18
  • 打赏
  • 举报
回复
打开游标时用adOpenStatic方式或adOpenKeyset方式。rs.open sql,conn,1,1
wgal 2001-12-18
  • 打赏
  • 举报
回复
不是的记录显示出来了,但是count的值不对
25475360 2001-12-18
  • 打赏
  • 举报
回复
说明没有符合条件的记录
wgal 2001-12-18
  • 打赏
  • 举报
回复
我写了select table1.depname,table2.username from table1,table2,table3
where table1.depid = table3.depid and table2.userid = table3.userid 之后

count=rs.recordcount统计出来的count不对是-1
BrightEye 2001-12-18
  • 打赏
  • 举报
回复
检查select语句字段名称是不是写错了?
wgal 2001-12-18
  • 打赏
  • 举报
回复
快来看看啊!
wgal 2001-12-18
  • 打赏
  • 举报
回复
我按上面的写了可是这句出错 rs1.open strsql,cn,1,1

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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