SQL中出错 [英] Error in SQL
问题描述
下午好。我有一个像这样的sql指令:
$
... IN'CurrentProject.Path& " \ historicoapolice.mdb'" &安培; _但它给了我错误
但如果我这样说:
.... IN 'C:\ loja seguros \ historicoapolice.mdb'" &安培; _不再重要了。
$
"historicoapolice.mdb"是用于存储客户历史记录的数据库。在主MDB中有一个按钮。单击执行sql语句并将选定的选项卡发送到历史记录。它没有连接到主要。我希望sql语句在安装mdb的任何地方运行
,因为mdb的文件夹是相同的。
所以,而不是...... IN'C:\\ \\ loja seguros \ historicoapolice.mdb'" &安培; _,我想这......"CurrentProject.Path& " \ historicoapolice.mdb'" &安培; _但它给了我错误。一定做错了什么,但是什么呢?
$
我做错了什么?有人能帮我吗?谢谢
Good afternoon. I have an sql instruction like that:
...IN 'CurrentProject.Path & " \ historicoapolice.mdb '" & _ But it gives me error
But if i put like this:
....IN ' C:\loja seguros\ historicoapolice.mdb '" & _ it does not matter anymore.
The "historicoapolice.mdb" is a database to store customer history. In the main MDB there is a button. Clicking executes the sql statement and sends the selected tab to history. It is not connected to the main. I would like the sql statement to run
anywhere where the mdb was installed, since the folder is the same for both mdb's.
So, rather than ....IN ' C:\loja seguros\ historicoapolice.mdb '" & _, i would like this......IN 'CurrentProject.Path & " \ historicoapolice.mdb '" & _ But it gives me error. Must doing something wrong, but what?
What i'm doing wrong? Can someone help me? Thank you
推荐答案
... IN'CurrentProject.Path& " \ historicoapolice.mdb'" &安培; _但它给了我错误
...IN 'CurrentProject.Path & " \ historicoapolice.mdb '" & _ But it gives me error
嗨Kidmania,
如你所愿CurrentProject.Path的值而不是文字文本,它必须在引用的字符串之外。
As you want the value of CurrentProject.Path and not the literal text, it must be outside the quoted string.
所以尝试类似:
"... IN '" & CurrentProject.Path & "\historicoapolice.mdb'" & …
Imb。
这篇关于SQL中出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!