Re: Maybe more of a VB question, but here goes

From: "Henshall, Stuart - WCP" <SHenshall(at)westcountrypublications(dot)co(dot)uk>
To: "'cgibbs(at)westmarkproducts(dot)com'" <cgibbs(at)westmarkproducts(dot)com>, pgsql-odbc(at)postgresql(dot)org
Subject: Re: Maybe more of a VB question, but here goes
Date: 2002-03-14 19:30:46
Message-ID: E2870D8CE1CCD311BAF50008C71EDE8E01F74827@MAIL_EXCHANGE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Try double quoteing (ie '' for ').
Also you can escape it using \'.
Of course bveign able to use \ as an escape character means that when they
really have one you have to give \\ :)
Cheers,
- Stuart

> -----Original Message-----
> From: Corey W. Gibbs [mailto:cgibbs(at)westmarkproducts(dot)com]
> Sent: 13 March 2002 18:14
> To: pgsql-odbc(at)postgresql(dot)org
> Subject: Maybe more of a VB question, but here goes
>
>
> Good Morning Everyone,
>
> I'm having a bit of a VB problem, and I don't know quite how
> to solve this
> as my VB knowledge is minimal at best. The problem is with
> quotes and
> apostrophes in variables. What I'm doing is pulling some
> really really
> really bad data from an Access database and trying to insert
> it into my
> handy dandy Postgres db.
>
> Here's the insert statement:
> pg_cn.Execute "INSERT into
> itemlist(jobno,area,floor,building,room,elevation,phase,cycle,
> model,w,h,
> d,itemno," & _
> "finish,mtostatus) values('" & rs!jobno & "','" & rs!area
> & "','" &
> rs!floor & "','" & rs!building & "','" & _
> rs!room & "','" & rs!elevation & "','" & rs!phase & "','"
> & rs!cycle &
> "','" & rs!model & "','" & rs!w & "','" & rs!h & "','" & _
> rs!d & "','" & rs!itemno & "','" & rs!finish & "','" &
> rs!mtostatus &
> "')"
>
> rs is an adodb recordset
>
> Now, if rs!d="7'" (I said it was bad data ;)) that tickmark
> throws off the
> whole insert statement. as they're interpreted as the genuine
> ticks. Has
> anyone come across this or can anyone point me in the right
> direction to
> solve this problem short of removing the users "-' key?
>
> thanks in advance
> corey
>
>

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Dave Page 2002-03-14 20:58:45 Re: Maybe more of a VB question, but here goes
Previous Message xoror 2002-03-14 15:49:08 Re: transaction bug with sequences ?