E2089 Identifier 'Button2Click' cannot have a type qualifier

原来以为是这里有问题,查了三次没发现问题,后来终于发现问题出在上面的一段Code里,{}没有对应,傻了。。。。

void __fastcall TForm1::Button2Click(TObject *Sender) { { String cxpf,mysql; cxpf=Edit3->Text; mysql="select * from record where peifang = '" + cxpf + "' ORDER BY PID"; ADOQuery1->Close(); ADOQuery1->SQL->Clear(); ADOQuery1->SQL->Add(mysql); ADOQuery1->Open(); if (!ADOQuery1->Eof) { int q=ADOQuery1->RecordCount; // StringGrid1-> Align=alClient; StringGrid1->RowCount=q+1; //设置StringGrid1的总行数 StringGrid1-> ColCount=5; StringGrid1->ColWidths[4]=120; StringGrid1-> Cells[1][0]= " 配方"; StringGrid1-> Cells[2][0]= " 细料代号 "; StringGrid1-> Cells[3][0]= " N.W."; StringGrid1-> Cells[4][0]= " 时间"; ADOQuery1->First(); for ( int i=0, sqlrow=1; i<q; i++, sqlrow++ ){ StringGrid1-> Cells[1][sqlrow]= ADOQuery1->FieldByName("peifang")->AsString; StringGrid1-> Cells[2][sqlrow]= ADOQuery1->FieldByName("xiliaodaihao")->AsString; StringGrid1-> Cells[3][sqlrow]= ADOQuery1->FieldByName("NW")->AsString; StringGrid1-> Cells[4][sqlrow]= ADOQuery1->FieldByName("pdt")->AsDateTime; //这句日期AsDateTime可否改为AsString ADOQuery1->Next(); } Label3->Caption="共找到"+IntToStr(q)+"条记录"; MemoRe->Lines->Add(Now()); } else ShowMessage("未找到任何记录"); } }

  

转载于:https://www.cnblogs.com/sspline/archive/2012/05/06/2485455.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值