for i:=0 to checklistbox1.Items.Count-1 do
checklistbox1.Checked[i]:=true;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('update user_info set che_flag=1 where 用户编号='+st.Strings[0]);
adoquery2.ExecSQL;怎么就写了第一条啊?
checklistbox1.Checked[i]:=true;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('update user_info set che_flag=1 where 用户编号='+st.Strings[0]);
adoquery2.ExecSQL;怎么就写了第一条啊?
begin
checklistbox1.Checked[i]:=true;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('update user_info set che_flag=1 where 用户编号='+st.Strings[0]);
adoquery2.ExecSQL;
end;
但是只更新了第一条数据啊·?
st.Strings[i]??
begin
checklistbox1.Checked[i]:=true;
adoquery2.SQL.Clear;
adoquery2.SQL.Add('update user_info set che_flag=1 where 用户编号='+st.String[i]);
adoquery2.ExecSQL;
end;
看看
i,j:integer;
st:Tstringlist;
begin
st:=Tstringlist.Create;
st.Delimiter:='|';
st.DelimitedText:=trim(CheckListBox1.Items[CheckListBox1.itemindex]);for i:=0 to checklistbox1.Items.Count-1 do
begin
checklistbox1.Checked[i]:=true; adoquery2.SQL.Clear;
adoquery2.SQL.Add('update user_info set che_flag=1 WHERE 用户编号='+st.Strings[0]) ;
adoquery2.ExecSQL; end;
end;不行··那个是每一行显示的|之前内容··
i,j:integer;
st:Tstringlist;
begin
st:=Tstringlist.Create;
st.Delimiter:='|';
for i:=0 to checklistbox1.Items.Count-1 do
begin
checklistbox1.Checked[i]:=true;
st.DelimitedText:=trim(CheckListBox1.Items[i]);
adoquery2.SQL.Clear;
adoquery2.SQL.Add('update user_info set che_flag=1 WHERE 用户编号='+st.Strings[0]) ;
adoquery2.ExecSQL; end;
end;