这是目前的代码,User_UID 的预定义值 IcuUser_UID 为 5;
我需要增加一个光标定位的功能,就是在查询的结果中,检索是否存在 User_UID = IcuUser_UID 。
如果存在,对应 DBGrid 的光标就停留在那一行。
如果不存在,就停在第一行,并将这行的 User_UID 赋值给 IcuUser_UID 。 with ADODataSet1 do
begin
Active:=false;
Connection := lADOConnection;
close;
CommandText :=' select UsersList.User_UID, UsersList.User_Name,'
+' iif(count(StudysList.Study_key) <20 ,count(StudysList.Study_key) ,20) as StudyNum from UsersList left join StudysList '
+' on StudysList.User_UID = UsersList.User_UID '
+' group by UsersList.User_UID,UsersList.User_Name ';
Active:=true;
end;
我需要增加一个光标定位的功能,就是在查询的结果中,检索是否存在 User_UID = IcuUser_UID 。
如果存在,对应 DBGrid 的光标就停留在那一行。
如果不存在,就停在第一行,并将这行的 User_UID 赋值给 IcuUser_UID 。 with ADODataSet1 do
begin
Active:=false;
Connection := lADOConnection;
close;
CommandText :=' select UsersList.User_UID, UsersList.User_Name,'
+' iif(count(StudysList.Study_key) <20 ,count(StudysList.Study_key) ,20) as StudyNum from UsersList left join StudysList '
+' on StudysList.User_UID = UsersList.User_UID '
+' group by UsersList.User_UID,UsersList.User_Name ';
Active:=true;
end;
解决方案 »
- Delphi中如何删除托盘图标?
- 怎样把安装第三方控件的过程做成安装程序
- 关于消息问题!
- 如何通过编程来检测本机上网与否?
- 急急急急。出现了“connection is busy with result for another hstmt"
- 如何在project中加入一个没有form只有*.pas的程序模块?
- 如何在delphi程序中调用“电脑播音员”这样的应用软件?
- 大家好,帮兄弟看一下这个木马
- 关于DELPHI中如何调用用VC编的动态链接库的??
- 关于 将Excel数据批量导入到Access中的问题!!!
- 用edit去修改数据库的问题(新手没分,不好意思)
- 谁开发过delphi的 DS_8000HC 系列网络硬盘录像机
顺便问个小问题, access+ado 中 小于等于 和 大于等于 是什么符号?
有个字段a ,数据是从 R-1001 到 R-1100, 现在要搜索范围
(R-1010 到 R-1090),这个不是数字,该怎么写啊?