SQL& VBA [英] SQL & VBA

查看:65
本文介绍了SQL& VBA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

两周前我已经问了同样的问题。所以,这是我的最后一次拍摄,希望有一个人有答案。

我在我的VBA代码中使用了很多SQL语句。我这样做:make

查询,转到SQL代码,将其复制并粘贴到我的VBA代码中。

现在这里是我的问题:每个我必须在VBA中进行相同类型的
更正才能使SQL工作:

例如SELECT tlbA.a& " " &安培; tblB.b as ab - >必须更改

" SELECT tblA.a& " &安培; chr $(34)& " " &安培; chr $(34)& " &安培; tblB.b as ab"

有没有人知道插件或功能可以自动执行这些类型的b $ b校正?我可以自己写一个,但我认为这是一个艰难的一个。

谢谢,

-

bebelino

Hello,
I''ve asked this same question two weeks ago or so. So, this is my last
shot in hoping there''s one person with an answer.
I use a lot of SQL statements in my VBA-code. I do it like this: make
the query, go the SQL code, copy and paste this in my VBA-code.
Now here''s my problem: each time I have to make the same sort of
corrections in VBA in order to make the SQL work:
e.g. "SELECT tlbA.a & " " & tblB.b as ab" --> has to be changed in
"SELECT tblA.a & " & chr$(34) & " " & chr$(34) & " & tblB.b as ab"
Does anyone know of a plugin or a function that can do these sort of
corrections automaticaly? I could write one myself, but I think it''s
gonna be a tough one.
Thanks,
--
bebelino

推荐答案

(34)& " " &安培; chr
(34) & " " & chr


(34)& " &安培; tblB.b as ab"

有没有人知道插件或功能可以自动执行这些类型的b $ b校正?我可以自己写一个,但我认为这是一个艰难的一个。

谢谢,

-

bebelino
(34) & " & tblB.b as ab"
Does anyone know of a plugin or a function that can do these sort of
corrections automaticaly? I could write one myself, but I think it''s
gonna be a tough one.
Thanks,
--
bebelino


使用单引号(撇号)而不是chr
It''s easier to use single quotes (apostrophes) rather than chr

这篇关于SQL& VBA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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