sqlite odbc 获取小时分钟。秒
我正在使用 sqliteodbc ,由于某种原因,它无法获取小时、分钟和秒。我使用以下方式绑定列:
SQLBindCol(hTimeStampNotes, 5, SQL_C_TIMESTAMP, &(noteTimeStamp.submitTime), 16, &junkLong);
noteTimeStamp.submitTime 是一种时间戳数据类型:
typedef struct tagTimeStampType {//TIMESTAMP_STRUCT
short year;
short month;
short day;
short hour;
short minute;
short second;
unsigned int fraction;
} TimeStampType;//TIMESTAMP_STRUCT;
我的小时、分钟、秒和分数始终显示为 0。这对我使用 access 数据库有效。还有其他人遇到过这个问题吗?一周前我就可以发誓这对我有用。
I am using sqliteodbc and for some reason it won't get the hours, minutes, and seconds. I bind the column using this:
SQLBindCol(hTimeStampNotes, 5, SQL_C_TIMESTAMP, &(noteTimeStamp.submitTime), 16, &junkLong);
noteTimeStamp.submitTime is a time stamp data type:
typedef struct tagTimeStampType {//TIMESTAMP_STRUCT
short year;
short month;
short day;
short hour;
short minute;
short second;
unsigned int fraction;
} TimeStampType;//TIMESTAMP_STRUCT;
My hour, minute, second, and fraction always come out as 0. This works for me using an access database. Has anybody else had this problem? I could have sworn that this was working for me a week ago.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我不明白为什么会发生这种情况,我是这样解决的:
首先我在类型的末尾添加了一个数组
,然后添加了#ifdef
,然后自己用一个小函数调整了字符串的速度,
我仍在尝试弄清楚弄清楚为什么我的原始代码不能与 sqlite 一起使用。
Ok I couldn't figure out why this was happening here is how I got around it:
first I added an array to the end of the type
then added #ifdef
and just paced the string myself with a little function
I am still trying to figure out why this my original code wouldn't work with sqlite.
几年过去了,但什么都没有改变:)
对于那些想知道实际原因的人:
...来自 sqlite3odbc.c
Years passed but nothing changed :)
For those who would like to know the actual reason:
...from sqlite3odbc.c