标准表达式绕过中的数据类型不匹配
我在 Access 上运行查询,尽管它警告我有关空字段的信息,但它仍然可以运行查询并添加行。
但是,当我在 VB.NET 中运行 JET 时,它显示“条件表达式中的数据类型不匹配”。
有没有办法让 JET 表现得像 Access(即仍然运行查询并添加行)?
我知道我可以在 VB.NET 中将字段转换为正确的类型并循环,但我没有时间这样做,因为我需要在许多不同的查询上执行此操作。
感谢您的帮助
I run a query on Access and although it warns me about null fields, it can still run the query and add the rows.
However, when I run through JET in VB.NET, it says "Data type mismatch in criteria expression".
Is there a way for JET to behave like Access (ie. still run the query and add the rows)?
I know I can convert the field to correct type in VB.NET and loop round, but I don't have the time for this as I need to do this on many different queries.
Thanks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将开始查看您有条件的字段,然后在查询中创建 select 语句,以便将空值更改为可接受的类型(尝试 IsNull 或 NZ),或者执行消除空值的派生表(子查询)在处理标准之前。
例如,
这是一个派生表解决方案:
本机你可以说:
希望有帮助
I would start looking at the fields that you have criteria for, then make your select statement in your query so that the nulls are changed to an acceptable type (try IsNull or NZ) or do a derived table (sub query) that eliminates the nulls before the criteria are processed.
For example
Here is a derived table solution:
Natively you could say:
Hope that helps