Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / February 2004

Tip: Looking for answers? Try searching our database.

Wild Card Concatenating with User Input

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roy - 26 Feb 2004 19:53 GMT
I am using an .adp file which is connected to the SQL
Server.  I have created a query stored procedure.  I now
am trying to search through one field, called NOTES, for
whatever the user inputs.  In the criteria cell for the
column NOTES I type in:

LIKE "%" & @userinput & "%"

Userinput is basically the message box that appears so
the user can enter a phrase to search for.  This does not
seem to work.  Anybody have any solutions.  Thank You!
Sylvain Lafontaine - 27 Feb 2004 05:46 GMT
You must add single quote ( ' ) to delimit strings in SQL:

   LIKE "'%" & @userinput & "%'"

You must also take care that there are no single quote in the @userinput or
to replace them with 2 single quotes.  In VBScript:  userinput = replace
(userinput, "'", "''").  Sorry, I don't remember the exact syntaxe for doing
this in T-SQL right now.

S. L.

> I am using an .adp file which is connected to the SQL
> Server.  I have created a query stored procedure.  I now
[quoted text clipped - 7 lines]
> the user can enter a phrase to search for.  This does not
> seem to work.  Anybody have any solutions.  Thank You!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.