如下所示:
ADODataset.Close;
ADODataset.CommandText:='select * from message where datetime>=#'+start_time.Text+'# and datetime<=#'+over_time.Text+'# and state=0 ';
ADODataset.Open;
if ADODataset.RecordCount >= 1 then
Application.MessageBox('查找成功!共找到'+IntToStr(ADODataset.RecordCount)+'条记录。','系统信息',MB_OK+MB_ICONINFORMATION);这样写为什么会出错?如果我想要把记录数目显示在这个弹出的消息框里,应该怎样写?我很菜!指大鸟们指点!谢谢!
ADODataset.Close;
ADODataset.CommandText:='select * from message where datetime>=#'+start_time.Text+'# and datetime<=#'+over_time.Text+'# and state=0 ';
ADODataset.Open;
if ADODataset.RecordCount >= 1 then
Application.MessageBox('查找成功!共找到'+IntToStr(ADODataset.RecordCount)+'条记录。','系统信息',MB_OK+MB_ICONINFORMATION);这样写为什么会出错?如果我想要把记录数目显示在这个弹出的消息框里,应该怎样写?我很菜!指大鸟们指点!谢谢!
比如这句:
Application.MessageBox('查找成功!','系统信息',MB_OK+MB_ICONINFORMATION);
就是显示一个有OK按钮的对话框,而对话框里面的内容就是查找成功!
可现在的问题是我要求里面显示的内容是“查找成功!共找到记录***条!”
而这个条数是根据ADODataset.RecordCount得到的。也就是说怎样把ADODataset.RecordCount得到的条数显示在对话框里面?
MessageBox(self.handle,pchar('查找成功!'+inttostr(iii)),'系统信息',MB_OK+MB_ICONINFORMATION);