Dear All:Do you happen to it?

luofuchun 2001-12-20 09:12:44
Dear All:
Please given Some Advice,ths!
enviroment: win2000,delphi5,
database engine: sqlAnywhere5.0
win200 system date format 'yy-mm-dd'
use AdoQuery to insert a date format data to a table ,

procedure TForm1.adotestClick(Sender: TObject);
begin
with ado do
begin
close;
sql.clear;
sql.Add('insert into test(f1) values(:date)');
parameters.ParamByName('date').value :=dx.asdatetime;//Dx is a component
that has initialized as '2001-12-12';
execsql;
end;
end;
initialization
ShortDateFormat:= 'YYYY-MM-DD';
DateSeparator := '-';
end.

after executed , use sqlAnywhere to query as following
'select convert(char(12),f1) from test ' the result is
'dec 12 1901' not 'dec 12 2001'
but use Tquery or set the date format 'yyyy-mm-dd' the result is correct;
how can i do??????
...全文
66 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
halfdream 2001-12-20
  • 打赏
  • 举报
回复
千年虫啊.
是sqlAnywhere的原因吧.
luofuchun 2001-12-20
  • 打赏
  • 举报
回复
有啊,可是也不行
baddy 2001-12-20
  • 打赏
  • 举报
回复
不会吧,你用的是D5还是D6,如是D5有打补丁了吗,D5UPDATE、ADO1、ADO2

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧