procedure from1.button1Click(Sender: TObject);
if combobox1.Items.Indexof(combobox1.Text) < 0 then
begin
with table1 do
begin
first;
while fieldbyname('nationality'.AsString <> '' do next;
if eof then //如果到了末尾,就添加一行//
append
else
edit;
fieldbyname('nationality').asstring:=combobox1.text;
post;
combobox1.Items.Add(combobox1.Text);
end;
end;
end;
if combobox1.Items.Indexof(combobox1.Text) < 0 then
begin
with table1 do
begin
first;
while fieldbyname('nationality'.AsString <> '' do next;
if eof then //如果到了末尾,就添加一行//
append
else
edit;
fieldbyname('nationality').asstring:=combobox1.text;
post;
combobox1.Items.Add(combobox1.Text);
end;
end;
end;
解决方案 »
- dbgrideh 小问题 !!!
- d7如何判断远程文件是否存在?如:判断http://www.163.com/123.rar是否存在!
- 急用!!怎样在已创建的表中创建新字段?
- 如何把剪粘板的内容导出,导入(我不知道剪粘板里存储的数据类型)
- 如何用delphi6.0制作日历?
- 程序员聊天交流,http://cngo.net/chat,刚弄成的,呵呵
- ActiveFrom求救!
- 外销员资格统考
- 数据转换问题,赶紧来取分~~
- 请问如果在程序中实现对一些文件的压缩,详情请看:
- 问题探讨:Database中,如果只往Table里增加数据,是用Table的好还是用TQuery好
- 关于TMenu和TPopupMenu?
第7行改为:
while not eof and fieldbyname('nationality'.AsString <> '' do next;
万王之王,你看到我写的程序,是不是要发疯啦,嘻嘻。
对了,我的表中是没有空白行了,movingboy,谢谢你哦。
还有一个问题:当出现如下情况时
edulevel nationality
高中 中国
本科 法国
硕士 中国
此时在combobox1中填入'法国',再按button1的话,数据表会怎么变?你有想过吗?