By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,107 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,107 IT Pros & Developers. It's quick & easy.

SQL and VBA

P: n/a
Hello,
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.
--
bebelino
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
It would appear as though you are trying to embed quotes into your sql
string. If you are trying to embed double-quotes into your select string,
use the double-double quotes or use a single quote inside of 2 double-quotes
to accomplish the same thing.
If not, what are you trying to do?
Nov 12 '05 #2

P: n/a
On Fri, 26 Sep 2003 15:12:33 -0500, "hal boyles"
<ha********@timeinc.com> wrote:
It would appear as though you are trying to embed quotes into your sql
string. If you are trying to embed double-quotes into your select string,
use the double-double quotes or use a single quote inside of 2 double-quotes
to accomplish the same thing.
If not, what are you trying to do?


That's another way of accomplish the same thing, but you still have to
make the same corrections over and over again with each SQL-statement
in the VBA-code. And it's that that I'm looking for to automate.
regards,
--
bebelino
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.