with query do
begin
close;
sql.clear;
sql.add('insert into table1 (date1,astr) values date1,:astr);
params[0].asdate:='2002-03-14';
params[1].asstring:='test';
prapare;
execsql;
end;
我在edit1中写上1998,使用了下面 一段程序,
try
StrToDateTime(Edit1.Text);
except
raise Exception.Create(/'不是日期型/');
end;
却出现警告对话框,内容如下
project project1.exe raised exception class EConvertError with message''1998'is not valid date and time',process stopped.Use step or run to continue.
请问,该怎么解决?