运行时错误'3464'CurrentDb.Execute [英] Run-Time error '3464' CurrentDb.Execute

查看:133
本文介绍了运行时错误'3464'CurrentDb.Execute的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我的INSERT INTO查询的语法有什么问题。有没有人立刻看到任何东西?

I am not sure what''s wrong with my syntax for my INSERT INTO query. Does anyone see anything right off the bat?

展开 | 选择 | Wrap | 行号

推荐答案

1)报告时请输入错误:

提供您正在使用的Office / Access版本。

错误消息中显示的EXACT标题(如果有)

错误消息中给出的确切文本

错误消息中给出的确切数字。

数字和文本在版本,消息和调用过程之间循环使用。


2)如果这是typemisma tch错误,然后其中一个值进入字段不是字段的正确类型转换。


3)字符串理论:

你通过在命令中建立标准字符串,偶然发现了我的一个烦恼 - 这不是你的错,因为大多数例子都是如何使用命令的。

相反,我建议您先构建字符串,然后在命令中使用该字符串。为什么你可能会问,因为你可以检查字符串是如何实际解决的;因此,对代码进行故障排除非常容易,因为大多数情况下问题是缺少某些内容或者没有正确解析/正如字符串中预期的那样。

所以要使用你的代码:
1) When reporting an error please:
Provide the Version of Office/Access you are using.
The EXACT title shown, if any, in the error message
The EXACT text as given in the error message
The EXACT number as given in the error message.
The numerics and text are recycled between versions, messages, and calling procedure.

2) If this is the typemismatch error then one of the values are are enteringing into the fields is not the correct type cast for the field.

3) The string theory:
You''ve stumbled upon one of my pet peeves by building the criteria string within the command - and it''s not your fault because that''s how a majority of examples show how to use the command.
Instead I suggest that you build the string first and then use the string in the command. Why you might ask, because you can then check how the string is actually resolving; thus, making troubleshooting the code so much easier as most of the time the issue is with something missing or not resolving properly/as expected within your string.
So to use your code:
展开 | 选择 | Wrap | 行号


zmbd,感谢您在回复中投入的时间。我想知道数据库和DAO.Database是否基本相同,或者DAO参考是否重要?我为我的OP缺乏明确表示道歉,这是一种类型不匹配的错误。 Luk3r,再次感谢您的帮助!
zmbd, thanks for the amount of time you put into your response. I am wondering if Database and DAO.Database are essentially the same, or if the DAO reference is important? I apologize for a lack of clarity in my OP, it is a type mismatch error. Luk3r,thanks again for your assistance!


我总是特别注意数据库的类输入

DAO / ADO / etc ...这避免了错误的语法。

由于我所做的大部分工作要么缩放到SQL-Server,要么保持在Access中,我倾向于使用DAO对象模型。如果它有可能移动到其他数据库之一,那么我可能会看看ADO模型。


使用泛型DATABASE类型转换会让事情变成其他人的控件这可能会给你带来很多问题。
I am always specfic with the class typing of the database
DAO/ADO/etc... this avoids having the wrong syntax.
As most of the work I do will either be scaled to SQL-Server or stay within Access, I tend to use the DAO object model. If there is a chance that it might move to one of the other databases then I might look at the ADO model.

Using the generic DATABASE typecast leaves things to somthing else''s control and that can cause you a lot of issues.


这篇关于运行时错误'3464'CurrentDb.Execute的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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