double quote in sql

  • Thread starter Thread starter Greg Chu
  • Start date Start date
G

Greg Chu

I am using vb.net to retrieve data from access mdb.

when I tried to specify a sql string

.... where xyz = "123"

how do I specify the double quote?

I tried use
dim sqlstr = .... & """ & "123" & """

it would not take the last """, complaing end of statement needed.

Please help!

Thanks!

Greg
 
Greg Chu said:
I am using vb.net to retrieve data from access mdb.

when I tried to specify a sql string

... where xyz = "123"

strSQL = "SELECT ... WHERE xyz = ""123"""
or
strSQL = "SELECT ... WHERE xyz = '123'"
 
dim sqlStr as String
dim sqlVar as String

sqlVar = "123"
sqlStr = "where xyz = """ & sqlVar & """"

In SQL you should be able to use a Single Quote instead. (Required in SQL
Server.)

sqlStr = "where xyz = '" & sqlVar & "'"
 
Greg,

To make the answers not to complicated for you, have a look at the answer
from Noozer,

The other answers are completly beside your question.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top