SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 1st, 2002, 12:42 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
asp.net to Access using Where Like

<i><b>Originally posted by : John Hankey (jhankey@blueyonder.co.uk)</b></i><br /><br />Using the following SP:<br /><br />SELECT *<br />FROM Inventory_Table<br />WHERE PartNumber Like "*"+@Search+"*";<br /><br />I get the correct result when running the SP from within Access , However passing @Search from my ASP page does not return any results.<br /><br />If I change the SP to a simple Select statement I get the results I expected, asssuming I pass the right string.<br /><br />Any Ideas?<br />

Reply With Quote
  #2  
Old April 2nd, 2002, 10:39 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : norm (norm@istar.ca)</b></i><br />Use single quotes, and % instead of *. The semicolon isn't necessary. Also, put the SQL string in a variable and then you can <br /><br />Response.Write strSQL<br />Response.End<br /><br />and then cut and paste the string right into Query Analyzer (if you're using SQL Server) to test them out. Access has its own bizarre syntax (and you can't do complex queries.)<br /><br /><br />SELECT *<br />FROM authors<br />WHERE au_lname Like '%'+'b'+'%'<br /><br /><br />------------<br />John Hankey at 4/1/2002 10:42:50 AM<br /><br /><br />Using the following SP:<br /><br />SELECT *<br />FROM Inventory_Table<br />WHERE PartNumber Like "*"+@Search+"*";<br /><br />I get the correct result when running the SP from within Access , However passing @Search from my ASP page does not return any results.<br /><br />If I change the SP to a simple Select statement I get the results I expected, asssuming I pass the right string.<br /><br />Any Ideas?<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > asp.net to Access using Where Like


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway