有个语句一直出错,提示数据类型不匹配。如下:
conn.execute("delete from pfjlb where 姓名='"&vxm&"' and 上班时间='"&vsbsj&"'")
句子本身看起来似乎没什么问题,经上网查询相关问题,终于知道写法上不对,应该写成:
conn.execute("delete from pfjlb where 姓名='"&vxm&"' and 上班时间=#"&vsbsj&"#")
问题解决。
原来在Access中查询日期时间型值需要用#括起来。
有个语句一直出错,提示数据类型不匹配。如下:
conn.execute("delete from pfjlb where 姓名='"&vxm&"' and 上班时间='"&vsbsj&"'")
句子本身看起来似乎没什么问题,经上网查询相关问题,终于知道写法上不对,应该写成:
conn.execute("delete from pfjlb where 姓名='"&vxm&"' and 上班时间=#"&vsbsj&"#")
问题解决。
原来在Access中查询日期时间型值需要用#括起来。