现在我有一个数据(日期型的),我打算把它从界面上显示出来,和这个数据相对应的是一个datetimepicker控件,我用了下面这种方法但是不行,
sshtbianji.datetimepicker1.Date:=datamodule.ADOTable.fieldByName('htqdt').AsDateTime;
我输入的时候用的语句是这样的:
datamodule.ADOTable.fieldByName('htqdt').AsDateTime:=sshtbianji.datetimepicker1.Date;
希望大哥们帮帮我!!!!!!!!!!!
sshtbianji.datetimepicker1.Date:=datamodule.ADOTable.fieldByName('htqdt').AsDateTime;
我输入的时候用的语句是这样的:
datamodule.ADOTable.fieldByName('htqdt').AsDateTime:=sshtbianji.datetimepicker1.Date;
希望大哥们帮帮我!!!!!!!!!!!
sshtbianji.datetimepicker1.Date:=datamodule.ADOTable.fieldByName('htqdt').AsDate;
sshtbianji.datetimepicker1.DateTime:=datamodule.ADOTable.fieldByName('htqdt').AsDateTime;
Debugger Exception Notification
---------------------------
Project gfguanliProject.exe raised exception class EAccessViolation with message 'Access violation at address 004CAD82 in module 'gfguanliProject.exe'. Read of address 00000320'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
---------------------------
Debugger Exception Notification
---------------------------
Project gfguanliProject.exe raised exception class EAccessViolation with message 'Access violation at address 004CAF62 in module 'gfguanliProject.exe'. Read of address 00000320'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
---------------------------
gfguanliproject
---------------------------
Access violation at address 004CAF62 in module 'gfguanliProject.exe'. Read of address 00000320.
---------------------------
确定
---------------------------
或者你设置的连接有问题
我在adotable的AfterScroll事件中写了这么一段程序!
procedure Tgfgldatamodule.ADOTableAfterScroll(DataSet: TDataSet);
begin
if (gfgldatamodule.sshtbianji_ADOT.FieldByName('htbhao').AsString<>'') then
begin
try
sshtbianji.htqdt.DateTime:=gfgldatamodule.sshtbianji_ADOT.fieldByName('htqdt').AsDateTime;
except
sshtbianji.htqdt.Date:=now;
end
else
begin
sshtbianji.htqdt.Date:=now;
end
end;
gfgldatamodule.sshtbianji_ADOT.first;
紧接着就出现了那些错误