Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TAdoQuery vs invalid parameters

Status
Not open for further replies.

rcloutie

Programmer
May 26, 2005
164
CA
Hi there,

I'm using Delphi 2006 with SQL Server 2005.
All my queries are using TAdoQuery without any parameters.

Here's an example:
SELECT ArtCode WHERE ArtDesc LIKE '%HUB FRONT 7"OD-4:1/2%'

When executing the query from within SQL Server, there's some results found. But when executing the same query from within my app (which is using TAdoQuery component), an error is raised: 'Invalid parameters...'

It seems that TAdoQuery waits for parameters because of 2 extra characters (" and :). If characters are splitted, it works well:
SELECT ArtCode WHERE ArtDesc LIKE '%HUB FRONT 7"OD%'
SELECT ArtCode WHERE ArtDesc LIKE 'OD-4:1/2%'

I tried to insert duplicate the " character (following the first one) without any result. Is there any way to specify to the TAdoQuery that there's no parameters?

Thanks a lot for help,

Rej Cloutier
 
I'm pretty sure if you set the ParamCheck property to False, it won't do this check.
 
You were pretty sure and you were pretty right!
Works great. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top