delphi DBGrid 如何获取当前选中行的某个字段的值 是dbgrid就应该是和数据库的表有关联,也就是用了query或table做了查询,当然显示可以依靠query或table来实现。比如在query的afterscroll事件里写赋值代码,edit1.text:=fieldbyname('id').asstring;用delphi获得数据库中字段值 with adoquery1 dobeginclose;sql.clear;sql.text:='select name from 表名';open;end;adoquery1.first;while not adoquery1.eof dobeginmemo1.lines.add(adoquery1.fieldbyname('name').asstring);adoquery1.next;end;Delphi怎么读取Excel表的所有字段名并读入到ComboBox tryFilePath:='G:\\新建.xls';Excel:=CreateOLEObject('Excel.Application');WorkBook:=Excel.WorkBooks.Open(FilePath);WorkSheet:=WorkBook.WorkSheets.Item[1];打开sheet1for I:=1 to WorkSheet.UsedRange.Columns.Count do/循环列beginShowMessage(WorkSheet.Cells[1,I]);取第一行所有列的值end;finallyWorkBook.Close;Excel:=Null;end;引用ComObj单元
随机阅读
- 丙烯怎么反应生成丙酮? 3-氯-1-丙醇生产工艺
- 陕西航空职业技术院和西飞工学院哪个好些 试飞院工学院官网
- 对甲基联苯的熔点 2-氰基-4'-甲基联苯是什么,有什么用途啊?
- 上海股票市场与深圳的股票市场 股票上海市场 深圳市场
- tt是不是应该在这里键个交易平台呢? 买卖武器的游戏
- 局促不安和大模大样的意思是什么 局促不安和大模大样是什么意思呢?
- 一起来捉妖幼尾狐攻略? 一起来捉妖毒属性怎么克制
- 运动凉鞋短袜 运动鞋与袜子要怎么穿出时尚感?
- 1苯基3氯丙烷 1-苯基-2-氯丙烷如何制备啊
- 永州冷水滩区那招二氧化碳焊工 特种作业操作证号在哪可以查询?
- 石门县人口多少 东山峰农场邱迎建
- 有源电力滤波器仿真详细步骤 关于利用有源电力滤波器(APF)进行电网谐波治理的问题?
- 煤是可再生能源么 可再生能源的生产数量是多少
- 杭州跟屁虫影视有限公司怎么样? 黄海林跟屁虫
- 宁德市皇品水产有限公司怎么样? 塔山村富田路21号位置宁德
- 鱼肉做刺身需要去皮吗 常熟市冶塘铅氧化厂
- 偏执性嫉妒妄想症 偏执型嫉妒妄想症
- 八一南昌起义死了多少人 广东大埔三河汇东村舟角院
- 如何看待今年雨果奖评选《三体3:死神永生》惜败《方尖碑之门》? 去沙特打工的壮工是干什么的
- 今年正月通知我们说是这里要拆迁正月十六来量房也发了拆迁方案,但那方案没盖章也没日期合法吗? 正月里拆墙好吗