Quotes in sql server query error.!

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jan 2009
Posts: 125
Reputation: blocker is an unknown quantity at this point 
Solved Threads: 0
blocker's Avatar
blocker blocker is offline Offline
Junior Poster

Quotes in sql server query error.!

 
0
  #1
Jun 1st, 2009
hello guys.!

I just have 1 problem right here. I have a variable declaration below:

  1. myVar ="Argie's"
  2. "Select * from [my Table] where [my Field] ='" & myVar & "';"

When i execute the query, it returns error because the myVar value contains Quotes and sql server does not allow it because it is its a reserve character.

Pls help.!

Thank you for your time.

God bless on this mother earth.!
Last edited by blocker; Jun 1st, 2009 at 2:03 am.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 125
Reputation: blocker is an unknown quantity at this point 
Solved Threads: 0
blocker's Avatar
blocker blocker is offline Offline
Junior Poster

Re: Quotes in sql server query error.!

 
0
  #2
Jun 1st, 2009
Originally Posted by blocker View Post
hello guys.!

I just have 1 problem right here. I have a variable declaration below:

  1. myVar ="Argie's"
  2. "Select * from [my Table] where [my Field] ='" & myVar & "';"

When i execute the query, it returns error because the myVar value contains Quotes and sql server does not allow it because it is its a reserve character.

Pls help.!

Thank you for your time.

God bless on this mother earth.!
Anyway ive already solved the problem..Just make the qoutes double.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC