错误13类型不匹配 [英] Error 13 Type Mismatch

查看:95
本文介绍了错误13类型不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我是VBA和Access的新手,所以如果我做错了,请原谅我:

我有以下代码,它给我一个错误13类型不匹配:

Hello,

I''m kind of new to VBA and Access, so please forgive me if I''m doing stuff all wrong:

I have the following code wich gives me a Error 13 Type Mismatch:

展开 | 选择 | Wrap | 行号

推荐答案

datum 是一个日期类型字段,对吗?如果是这样,您需要在SQL字符串中的日期值周围放置分隔符。请参阅解释此问题的 Access文章


另外,我认为SQL要求日期采用美国格式(m / d / y),这可能是也可能不是问题。我建议你在设置strSQL的行之后暂停执行,并在字符串中显示值。如果你愿意,可以在这里发布,我们可以看到它的样子..
datum is a date type field, right? If so, you need to place # delimiters around the date values in the SQL string. See the Access article which explains the issue.

Also, I believe SQL requires dates to be in U.S. format (m/d/y), which may or may not be a problem. I''d suggest you halt execution after the line that sets strSQL, and display the value in the string. Post it here if you like, and we can see how it looks..


是的,你是对的,它是一个日期字段。但是:我尝试在约会时使用#,但这不起作用。此外,当我根本不使用任何WHERE语句时,我得到相同的错误:
Yes, you are right, it is a date field. However: I tried using # around the dates, this did not work. Also, I get the same error when I don''t use any WHERE-statement at all:
展开 | 选择 | Wrap | 行号



是的,你是对的,它是一个日期字段。但是:我尝试在约会时使用#,但这不起作用。此外,当我根本不使用任何WHERE语句时,我得到相同的错误:
Yes, you are right, it is a date field. However: I tried using # around the dates, this did not work. Also, I get the same error when I don''t use any WHERE-statement at all:
展开 | 选择 | Wrap | 行号


这篇关于错误13类型不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆