你可以用两个query 去链数据库!
一个显示全部记录也就是
select * from table
另一个则有条件,也就是你说的离职的?
select * from table where 字段='离职'
一个显示全部记录也就是
select * from table
另一个则有条件,也就是你说的离职的?
select * from table where 字段='离职'
解决方案 »
- 我用isqlw命令执行SQL脚本文件,在本机作服务器上执行成功,可做为客户端向服务器上执行就不成功?
- 购买屏幕取词程序原代码--win98,win2k,winxp屏幕取词程序原代码,能取IE的
- 如何解决"Statement expected but 'FUNCTION'错误
- 动态加载DLL异常!
- 对于1万条记录的单机版软件用什么数据库最佳?
- 如何设置Delphi中永久列对象的列标题字体大小及对齐方式
- 怎样用sqlserver存取声音文件??
- 使用两个combobox实现年月选择并查询
- DELPHI怎么实现读取SQL数据库的实时数据据呢?
- 如何控制不同机器上相同的应用程序不同时读取一条纪录
- ADOConnection的连接问题?
- 如何处理系统提示的问题?
begin
insert into 表二;
delete from 表一;
end;
datasouce2.dataset:=query2;
dbgrid1.datasource:=datasource1;
dbgrid2.datasource:=datasource2;
with query1 do
begin
close;
sql.clear;
sql.add('select * from empTable');
open;
end;
with query2 do
begin
close;
sql.clear;
sql.add('select * from emptable where 工作状况:="离职"')
open;
end;
放一个AdoQuery,一个DataSource,一个DbGrid,DataSource的DataSet设为AdoQuery,DbGrid的DataSource设为DataSource.
代码部分:
procedure TForm1.Button1Click(Sender: TObject);
begin
AdoQuery1.Sql.Add('select * "from personnel_No.DB" where fieldname=:value');
AdoQuery1.Parameters[0].Value:= '组长';
AdoQuery1.open;
end;
不过编译执行时出现这样的错误信息:List index out of bounds(0)
var kk:int;
source1:=adoquery1.sql.add('select * from table where 字段 '离职');
kk:=adoquery1.recno;
source2:=adoquery1.sql.add('select * from table);
kk:=adoquery1.recno=kk;这样应该可以啦!你试试吧!
用一个最笨的方法去解决它。(两个数据源)var kk:int;
source1:=adoquery1.sql.add('select * from table where 字段 ='离职'');
kk:=adoquery1.recno;
source2:=adoquery1.sql.add('select * from table');
kk:=adoquery1.recno=kk;这样应该可以啦!你试试吧!
你的方法也无法达到目的。不过还是要谢谢你。
请各位大侠继续关注!!!
var
i:integer;
begin
if table1.fieldbyname('').asstring='离职'then
begin
table2.active:=true;
table2.edit;
for i:=0 to table2.recordcount-1 do
table2.field[i]:=table1.field[i];
table2.post;
end;
end;