读书人

ACCESS 的时间格式,该怎么处理

发布时间: 2012-05-21 18:04:41 作者: rapoo

ACCESS 的时间格式


form.oledbcommand1.commandtext=" select content from note where thetime = "2012-05-18" "

其中:
连接的是ACCESS的数据库
thetime 是 日期型的

我只知道是thetime="2012-05-18"是错了,
只是不知道为什么错了,该怎么改



[解决办法]
如果是日期型字段要这样

form.oledbcommand1.commandtext=" select content from note where thetime = #2012-05-18#"

[解决办法]
form.oledbcommand1.commandtext=" select content from note where thetime = #" + t + "#";

.NET都是使用+
&是vb时代的写法,虽然VB.NET也可以使用

读书人网 >VB Dotnet

热点推荐