vb 识别不了俩种日期格式一个是文本格式 一个是日期格式

vb 识别不了俩种日期格式一个是文本格式 一个是日期格式。
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" xxx ";Extended Properties='Excel 8.0;HDR=Yes'"
语句是 MSFlexGrid1.TextMatrix(j , 3) = rs("扫描日期")
![图片说明](https://img-ask.csdn.net/upload/201507/19/1437300591_241681.jpg)图片说明

图片说明
前一个是VB里面的msflexgrid 后面的EXCEL里面的表格

 看下是不是有前导空格?
你可以用如下函数转换:
function fixdate(s as string)
    dim a as string()
        a = split(s, "-")
        dim y as string
        y = a(0)
        dim m as string
        m = a(1)
        if len(m) = 1 then m = "0" & m
        d = a(2)
        if len(d) = 1 then d = "0" & d
        fixdate = y & "-" & m & "-" & d
        end function
 function fixdate(s as string)
    dim a() as string
    a = split(s, "-")
    dim y as string
    y = a(0)
    dim m as string
    m = a(1)
    if len(m) = 1 then m = "0" & m
    d = a(2)
    if len(d) = 1 then d = "0" & d
    fixdate = y & "-" & m & "-" & d
end function