Connecting Tech Pros Worldwide Help | Site Map

double qutes inside string ?

  #1  
Old November 13th, 2005, 11:03 AM
Zlatko Matiæ
Guest
 
Posts: n/a
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.


  #2  
Old November 13th, 2005, 11:04 AM
Salad
Guest
 
Posts: n/a

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.
  #3  
Old November 13th, 2005, 11:05 AM
Phil Stanton
Guest
 
Posts: n/a

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 Threads
Thread Thread Starter Forum Replies Last Post
to split the string dheenaalex answers 18 October 30th, 2008 11:57 AM