double quotes inside VBA string ?

Started by Zlatko Matićalmost 21 years ago4 messagesgeneral
Jump to latest
#1Zlatko Matić
zlatko.matic1@sb.t-com.hr

Hello.
I have a problem when working with MS Access/PostgreSQL.
Namely, as PostgreSQL syntax uses doble quotes for table names and field names, when I write it as a string of a pass-through query or Command text of ADO Command object it looks like:
"select * from public."Customers""
and VBA considers that the first quote after public. is the end of statement.

How to solve it ?

#2Pascual De Ruvo
deruvo@gmail.com
In reply to: Zlatko Matić (#1)
Re: double quotes inside VBA string ?

If you need to use a double quote inside a VB string, you have to write two
double quotes (double double quotes!),
so your command will be something like:

"select * from public.""Customers"""

Show quoted text

On 5/18/05, Zlatko Matić <zlatko.matic1@sb.t-com.hr> wrote:

Hello.
I have a problem when working with MS Access/PostgreSQL.
Namely, as PostgreSQL syntax uses doble quotes for table names and field
names, when I write it as a string of a pass-through query or Command text
of ADO Command object it looks like:
"select * from public."Customers""
and VBA considers that the first quote after public. is the end of
statement.

How to solve it ?

#3Jeff Eckermann
jeff_eckermann@yahoo.com
In reply to: Zlatko Matić (#1)
Re: double quotes inside VBA string ?

""Zlatko Mati�"" <zlatko.matic1@sb.t-com.hr> wrote in message
news:001d01c55bab$87607cf0$99301dc3@zlatkovyfkpgz6...
Hello.
I have a problem when working with MS Access/PostgreSQL.
Namely, as PostgreSQL syntax uses doble quotes for table names and field
names, when I write it as a string of a pass-through query or Command text
of ADO Command object it looks like:
"select * from public."Customers""
and VBA considers that the first quote after public. is the end of
statement.

How to solve it ?

This question is OT really, but...
Make your command string something like:
"select * from public." & chr(34) & "Customers" & chr(34).

Better yet, change the table names to be all lower case. Access won't care
at all, and your life with PostgreSQL will be easier.

#4Sim Zacks
sim@compulab.co.il
In reply to: Zlatko Matić (#1)
Re: double quotes inside VBA string ?

double up the double quotes. "select * from public.""Customers"""
In any case, I agree with jeff, make your table names lowercase and leave out the quotes.

Sim
"Zlatko Matić" <zlatko.matic1@sb.t-com.hr> wrote in message news:001d01c55bab$87607cf0$99301dc3@zlatkovyfkpgz6...
Hello.
I have a problem when working with MS Access/PostgreSQL.
Namely, as PostgreSQL syntax uses doble quotes for table names and field names, when I write it as a string of a pass-through query or Command text of ADO Command object it looks like:
"select * from public."Customers""
and VBA considers that the first quote after public. is the end of statement.

How to solve it ?