single quote problem in sqlquery

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI

I'm using dataadapter to fill the data in the dataset from microsoft access. I have a query for that but the query contains filter condition for which the data itselt contains a single quote.So due to that I get a syntax error.What could be the solution for this

Thanks in advance
 
Use replace comman

Dim strLocalVariable as strin

strLocalVariable = Replace(Me.txtFieldName.Text, "'", "''"

- Vija

----- Kshitij wrote: ----

HI

I'm using dataadapter to fill the data in the dataset from microsoft access. I have a query for that but the query contains filter condition for which the data itselt contains a single quote.So due to that I get a syntax error.What could be the solution for this

Thanks in advance
 
Add one more single quote with already existing single quote. Then it will work

Thanks
Rajagopal.S
 

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