请问大侠,我在录入日期的时候格式是2009-10-12,为什么录入到数据库中在mshflexgrid上显示却是10/12/2009(这个时间格式是什么格式的long date还是short date,那么前面的那个格式又是什么格式的,我在设置查询的时候:代码如下
With Adodc1
.CursorType = adOpenDynamic
.CommandType = adCmdText
.RecordSource = "select * from storage where 入库时间='" + Format(Text5.Text, "short date") + "'"
.Refresh
End With
Set MSHFlexGrid1.DataSource = Adodc1
就会报错,该如何更改代码呢,谢谢了
With Adodc1
.CursorType = adOpenDynamic
.CommandType = adCmdText
.RecordSource = "select * from storage where 入库时间='" + Format(Text5.Text, "short date") + "'"
.Refresh
End With
Set MSHFlexGrid1.DataSource = Adodc1
就会报错,该如何更改代码呢,谢谢了
存储格式与录入和显示格式均无关。mshflexgrid上显示可以设置显示格式。.RecordSource = "select * from storage where 入库时间=#" & Format(Text5.Text, "yyyy-mm-dd") & "#"