我的问题是这样的
1:在一个表里一个字段中有 " 小王,小李,小赵'' 内容(就这个格式并不一定就这几个字段) 我怎样把小王,小李,小赵一一的取出来?
2:在checklistbox里显示的是 □小王 □小李 □小赵 □小高 怎样把在小王,小李,小赵上打上勾??
1:在一个表里一个字段中有 " 小王,小李,小赵'' 内容(就这个格式并不一定就这几个字段) 我怎样把小王,小李,小赵一一的取出来?
2:在checklistbox里显示的是 □小王 □小李 □小赵 □小高 怎样把在小王,小李,小赵上打上勾??
解决方案 »
- 高手们帮帮忙
- 请教各位大侠,能否介绍一下delphi是如何组织sql语句的,比如说程序中调用ttable.delete,delphi会组织一条delete语句.
- 问一菜鸟问题--什么是VTM?
- Rave 直接打印功能
- 关于SQL备份的问题(大家多指教)
- delphi设置ini文件动态读取数据库配置,为什么跳不出Fdataset
- 急问题,在MID窗口中,我如何知道,某一个窗口是否已经关闭?在线等待
- web broker+internetExpress做的系统中怎么样设置权限呢?
- 请问如何把我的程序永远置于前台
- 请问国内最出名的几个下载网站是?
- 求一个统计类的SQL语句,想了好半天没有答案了
- 如何实现把保存在ORACLE数据库BLOB字段中的WORD文挡用WORD打开 200410
i: integer;
begin
CheckListBox1.Items.Delimiter := ',';
CheckListBox1.Items.DelimitedText := '小王,小李,小赵'; for i := 0 to CheckListBox1.Items.Count - 1 do
CheckListBox1.Checked[i] := True;end;
sL.Text := '小王,小李,小赵' ;
sL.Delimiter := ',' sL.Strings[0]
sL.Strings[1]
類似這樣的操作分開
query1.sql.add('select 字段 from 表');
query1.close;
query1.open;query1.first;
checklistbox1.items.clear;
while not query1.eof do
begin
checklistbox1.items.add(query1.fieldbyname('字段').asstring);
CheckListBox1.Checked[CheckListBox1.Count-1]:=true;
query1.next;
end;
var
i:integer;
begin
CheckListBox1.Clear;
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('Select * from XXX');
ADOQuery1.Open; ADOquery1.First;
//读取
While ADOQuery1.Eof<>True then
begin
CheckListBox1.Items.Add(ADOQuery1.fieldByName('字段名').AsString);
end; //选定
For i:=0 to ADOquery1.RecordCount-1 do
CheckListBox1.Checked[i]:=True;
end;
小王,小李,小赵' 是打上勾了 可是小高不再显示了啊
我还想让小高也显示
i: integer;
begin
CheckListBox1.Items.Delimiter := ',';
CheckListBox1.Items.DelimitedText := '小王,小李,小赵,小高'; for i := 0 to CheckListBox1.Items.Count - 1 do
if CheckListBox1.Items[i]<>'小高' then
CheckListBox1.Checked[i] := True;end;
i: integer;
begin
CheckListBox1.Items.Delimiter := ',';
CheckListBox1.Items.DelimitedText := '小王,小李,小赵,小高'; for i := 0 to CheckListBox1.Items.Count - 1 do
CheckListBox1.Checked[i] := True;end;你把它加上就行了啊。
checklistbox1.items.add(query1.fieldbyname('字段').asstring);
if (query1.fieldbyname('字段').asstring='小高') then
exit
else
CheckListBox1.Checked[CheckListBox1.Count-1]:=true;
query1.next;
end;
checklistbox1.items.add(query1.fieldbyname('字段').asstring);
if (query1.fieldbyname('字段').asstring<>'小高') then
CheckListBox1.Checked[CheckListBox1.Count-1]:=true;
query1.next;
end;
var
i: integer;
begin
CheckListBox1.Items.Delimiter := ',';
CheckListBox1.Items.DelimitedText := '小王,小李,小赵,小高'; for i := 0 to CheckListBox1.Items.Count - 1 do
CheckListBox1.Checked[i] := CheckListBox1.Items[i]<>'小高';
end;