Connecting Tech Pros Worldwide Forums | Help | Site Map

double qutes inside string ?

Zlatko Matiæ
Guest
 
Posts: n/a
#1: Nov 13 '05
Hello.
I have a problem when writing strings for pass-through queries or command
text for ADO command object while working with PostgreSQL as back-end.
Namely, SQL dialect syntax uses double quotes for table name and field name,
something like this:
select * from public."Customers"
Therefore, when I put it as string in VBA it looks like:
"select * from public."Customers""
and VBA thinks that " after public. is the end of statement.

How to solve it?

Thanks.



Salad
Guest
 
Posts: n/a
#2: Nov 13 '05

re: double qutes inside string ?


Zlatko Matiæ wrote:
[color=blue]
> Hello.
> I have a problem when writing strings for pass-through queries or command
> text for ADO command object while working with PostgreSQL as back-end.
> Namely, SQL dialect syntax uses double quotes for table name and field name,
> something like this:
> select * from public."Customers"
> Therefore, when I put it as string in VBA it looks like:
> "select * from public."Customers""
> and VBA thinks that " after public. is the end of statement.
>
> How to solve it?
>
> Thanks.
>
>[/color]
See if
"select * from public.""Customers"""
works.
Phil Stanton
Guest
 
Posts: n/a
#3: Nov 13 '05

re: double qutes inside string ?


I think
"select * from public." & Chr$(34) & "Customers" & Chr$(34)"
is easier to understand (Chr$(34) is ASCII for ")

Try it
Phil

"Salad" <oil@vinegar.com> wrote in message
news:XjKie.3914$Ri4.479@newsread1.news.pas.earthli nk.net...[color=blue]
> Zlatko Matiæ wrote:
>[color=green]
>> Hello.
>> I have a problem when writing strings for pass-through queries or command
>> text for ADO command object while working with PostgreSQL as back-end.
>> Namely, SQL dialect syntax uses double quotes for table name and field
>> name, something like this:
>> select * from public."Customers"
>> Therefore, when I put it as string in VBA it looks like:
>> "select * from public."Customers""
>> and VBA thinks that " after public. is the end of statement.
>>
>> How to solve it?
>>
>> Thanks.
>>
>>[/color]
> See if
> "select * from public.""Customers"""
> works.[/color]


Closed Thread


Similar Microsoft Access / VBA bytes