combobox1.Clear;
query1.first;
while not query1.eof do
begin
ComboBox1.Items.Add(Query1.fieldByname('Shop_name').AsString;
query1.Next;
end;
query1.close;
query1.first;
while not query1.eof do
begin
ComboBox1.Items.Add(Query1.fieldByname('Shop_name').AsString;
query1.Next;
end;
query1.close;
我认为此句 //Query1.ExecSQL;//不妥当。应改为Query1.open;
前者不返回数据,所以无法提取。只有用后者才能返回数据,这才能提取的可能。//shop_name 是alpha型
combobox1.Clear;
query1.first;
while not query1.eof do
begin
ComboBox1.Items.Add(Query1.fieldByname('Shop_name').AsString;
query1.Next;
end;
query1.close;
fieldByname(field_name).Asfloat
fieldByname(field_name).Asdatetime
.
.
.
query1.Fields[1].Value
query1.Fields[2].Value
.
.
.
query1.Fields[n].Value
特别谢谢madyak(学习) ,他说的果然是对的我的问题,迟到的也有分我加分给
如果用Fields[1]或>=1运行时就会出错:List indos out of bounds(1)(我里面的记录有4条)这是为什么啊??