表的结果如下:
create table (struct varchar(10) not null primary key)
在form下save代码:
datamodule1.tablestruct.post;
在table的BeforePost代码如下:
if tablestruct.locate('struct',frmstruct.dbedit1.text,[]) then
showmessage('数据重复,请确认后重新输入');
运行时产生错误"stack overflow!"
请教该怎么解决数据输入重复的提示?
create table (struct varchar(10) not null primary key)
在form下save代码:
datamodule1.tablestruct.post;
在table的BeforePost代码如下:
if tablestruct.locate('struct',frmstruct.dbedit1.text,[]) then
showmessage('数据重复,请确认后重新输入');
运行时产生错误"stack overflow!"
请教该怎么解决数据输入重复的提示?
解决方案 »
- 在delphi2007下开发的MIS可否在没有NET框架的电脑上运行
- 请问String类型如edit.text 怎样判断输入的字符是数字而不是其他字符?
- 请问如何得到两个时间相差多少秒
- 关于StringGrid的一个小问题(解决后立即给分)
- 怎么写一个ASP的DLL 只要HELLO word 就行,谢谢谢谢谢谢
- 关于socket编程问题,新手请教!在线等待!
- 如何做出Windows中显示属性里面调整屏幕分辨率一样的TrackBar?
- commandtext changes are not allowed 错误
- [求职]:地点-->西安,详见内...
- 如何通过单机button实现listbox图标的变化
- 哈哈~高兴高兴~祝小小和百合携手共创美好未来!!!!!
- 在DELPHI7.0中如何实现出生日期统计直方图
本身已经在进行post操作了,你又去locate移动记录,当然会出错
你应该用另一个Query直接从数据库中查询是否有重复,
因为就算是你的代码不出错,locate也只不过是从你的table 中查找是否重复
而不会在数据库中判断是否重复,这样也就没有意义!