首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

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

2012-05-21 
ACCESS 的时间格式form.oledbcommand1.commandtext select content from note where thetime 2012-05

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也可以使用

热点排行