OLEDB和日期和时间戳 [英] OLEDB and Dates and Timestamps

查看:108
本文介绍了OLEDB和日期和时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是世界上唯一一个选择日期和时间戳的人吗?

OLEDB?

UDB的V8给我带来了一个大问题。


PATCH2 = 24设置不再像以前那样工作。 MAPDATEDESCRIBE = 1,MAPTIMEDESCRIBE = 1,

MAPTIMESTAMPDESCRIBE = 1的

设置允许我几乎反转V8的变化。

之前V8,在OLEDB中返回的日期列的格式基于客户端的区域设置基于

。现在,它返回

YYYY-MM-DD。猜猜我的所有网络服务器都有他们的区域

设置! MM-DD-YYYY!你能想象我正在经历的大规模歇斯底里和农民

土地掠夺!


我在留言板上没有提到这一点。有什么东西我会丢失吗?有没有人有办法处理时间戳,

日期和OLEDB或ADO中的时间?


TIA,


Craig Wahlmeier

高级技术管理员 - 数据库系统

Data-Tronics Corp.

Am I the only one in the world that selects dates and timestamps with
OLEDB?
V8 of UDB has brought me a big problem.

The PATCH2=24 setting no longer works the way it used to. The
settings of MAPDATEDESCRIBE=1, MAPTIMEDESCRIBE=1, and
MAPTIMESTAMPDESCRIBE=1 allow me to reverse that V8 change, almost.
Before V8, the format of a date column returned in OLEDB was based
upon the regional settings of the client. Now, it returns it in
YYYY-MM-DD. Guess what all my web servers have for their regional
settings! MM-DD-YYYY! Can you imagine the mass hysteria and peasant
land seizure that I am experiencing!

I see no mention of this on the message board. Is there something I
am missing? Does anyone have a slick way of dealing with timestamps,
dates, and times in OLEDB or ADO?

TIA,

Craig Wahlmeier
Senior Technical Administrator - Database Systems
Data-Tronics Corp.

推荐答案

将目标变量的数据类型定义为日期/时间戳变量;

然后您将获得本机格式(例如,对于VB6,您将获得日期)。你只有当你试图转换为字符串

表示时才会出现问题。


Craig Wahlmeier < CW ******** @ data-tronics.com>在消息中写道

news:ac ************************** @ posting.google.c om ...
Define the datatype of your target variable as a date / timestamp variable;
then you''ll get the native format (e.g., for VB6, you get a Date). You
problem only arises as your''e attempting to convert to a string
representation.

"Craig Wahlmeier" <cw********@data-tronics.com> wrote in message
news:ac**************************@posting.google.c om...
我是世界上唯一一个用OLEDB选择日期和时间戳的人吗?
UDB的V8给我带来了一个大问题。

PATCH2 = 24设置不再像过去那样工作。 MAPDATEDESCRIBE = 1,MAPTIMEDESCRIBE = 1,
MAPTIMESTAMPDESCRIBE = 1的
设置允许我几乎反转V8的变化。
在V8之前,OLEDB中返回的日期列的格式是基于客户的区域设置。现在,它返回到YYYY-MM-DD。猜猜我的所有网络服务器对于他们的区域
设置有什么用! MM-DD-YYYY!你能想象我正在经历的大规模歇斯底里和农民的土地掠夺!

我在留言板上没有提到这一点。我有什么遗失的东西吗?有没有人有办法处理OLEDB或ADO中的时间戳,日期和时间?

TIA,

Craig Wahlmeier
高级技术管理员 - 数据库系统
Data-Tronics Corp.
Am I the only one in the world that selects dates and timestamps with
OLEDB?
V8 of UDB has brought me a big problem.

The PATCH2=24 setting no longer works the way it used to. The
settings of MAPDATEDESCRIBE=1, MAPTIMEDESCRIBE=1, and
MAPTIMESTAMPDESCRIBE=1 allow me to reverse that V8 change, almost.
Before V8, the format of a date column returned in OLEDB was based
upon the regional settings of the client. Now, it returns it in
YYYY-MM-DD. Guess what all my web servers have for their regional
settings! MM-DD-YYYY! Can you imagine the mass hysteria and peasant
land seizure that I am experiencing!

I see no mention of this on the message board. Is there something I
am missing? Does anyone have a slick way of dealing with timestamps,
dates, and times in OLEDB or ADO?

TIA,

Craig Wahlmeier
Senior Technical Administrator - Database Systems
Data-Tronics Corp.



Mark,


谢谢你的支持答复。我们在ASP页面中使用VBScript。

如您所知,VBScript是无类似REXX的。 IBM确实让这个

V8转换变得一团糟!为了增加对伤害的侮辱,我只是注意到

MAPTIMESTAMPDESCRIBE = 1返回一个缺少短划线的时间戳,

,例如2001-01-01 00.00.00.000000。


我去年11月开设了PMR 46073,370。我花了一个星期的时间来说服

代表你确实可以通过OLEDB选择时间戳!我自己想出了MAPDATEDESCRIBE的
并关闭了PMR。我想我会打开另一个b $ b。我仍然无法相信我们是唯一通过Active Server Pages中的OLEDB访问DB2并且遇到问题的人。


谢谢,


Craig Wahlmeier

高级技术管理员 - 数据库系统

Data-Tronics Corp.
Mark,

Thank you for your reply. We are using VBScript inside of ASP pages.
As you know, VBScript is untyped like REXX. IBM has really made this
V8 conversion a mess! To add insult to injury, I just noticed that
the MAPTIMESTAMPDESCRIBE=1 returns a timestamp that is missing a dash,
e.g. 2001-01-01 00.00.00.000000.

I opened PMR 46073,370 last November. I took me a week to convince
the rep that you could indeed select a timestamp via OLEDB! I figured
out the MAPDATEDESCRIBE myself and closed the PMR. I guess I will
open another. I still cannot believe that we are the only ones
accessing DB2 via OLEDB in Active Server Pages and having a problem.

Thanks,

Craig Wahlmeier
Senior Technical Administrator - Database Systems
Data-Tronics Corp.


我们总是选择日期为CHAR(MyDateField),然后操作

ASP代码,

,因为我们的DBA喜欢存储尚未发生的日期 - 即

termination_date
对于活跃员工的
为0001-01-01,除非您将
作为字符串字符串获取,否则ADO适合。从来没有运气从DB2通过ADO操纵

时间戳。可以比较时间戳,如...

A.ts = B.ts,但永远不能执行查询,在ASP

变量中保存ts并再次使用通过ASP / ADO查询...


Phil J.

We always select dates as CHAR(MyDateField) and then manipulate in the
ASP code,
as our DBAs like to store dates that have not happened - i.e.
termination_date
for an active employee as 0001-01-01, which gives ADO fits unless you
fetch as a charactor string. Have NEVER had any luck manipulating
timestamps from DB2 via ADO. Can compare timestamps as in ... where
A.ts = B.ts, but never able to execute a query, save ts in an ASP
variable and use again in a query via ASP/ADO...

Phil J.

Mark,
谢谢你的回复。我们在ASP页面中使用VBScript。
如您所知,VBScript是无类似REXX的。 IBM确实让这个V8转换变得一团糟!为了增加对伤害的侮辱,我只是注意到MAPTIMESTAMPDESCRIBE = 1会返回一个缺少短划线的时间戳,例如: 2001-01-01 00.00.00.000000。

我去年11月开设了PMR 46073,370。我花了一个星期的时间来说服代表你确实可以通过OLEDB选择时间戳!我自己想出了MAPDATEDESCRIBE并关闭了PMR。我想我会打开另一个。我仍然无法相信我们是唯一通过Active Server Pages中的OLEDB访问DB2并遇到问题的人。

谢谢,

Craig Wahlmeier 高级技术管理员 - 数据库系统
Data-Tronics Corp.
Mark,

Thank you for your reply. We are using VBScript inside of ASP pages.
As you know, VBScript is untyped like REXX. IBM has really made this
V8 conversion a mess! To add insult to injury, I just noticed that
the MAPTIMESTAMPDESCRIBE=1 returns a timestamp that is missing a dash,
e.g. 2001-01-01 00.00.00.000000.

I opened PMR 46073,370 last November. I took me a week to convince
the rep that you could indeed select a timestamp via OLEDB! I figured
out the MAPDATEDESCRIBE myself and closed the PMR. I guess I will
open another. I still cannot believe that we are the only ones
accessing DB2 via OLEDB in Active Server Pages and having a problem.

Thanks,

Craig Wahlmeier
Senior Technical Administrator - Database Systems
Data-Tronics Corp.



这篇关于OLEDB和日期和时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆