Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 19th, 2006, 04:26 PM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SELECT Problems

this is my code.

Select Case UCase (Request.QueryString("view"))
    Case "ALL"
        sqltext = "SELECT * FROM Jobs WHERE status=1 "
    Case Else
        TheMessage = "Search Results"
        sqltext = "SELECT * FROM Jobs "
        sqltext = sqltext & " WHERE " & varin
        sqltext = sqltext & " AND status=1"
        sqltext = sqltext & " LIKE '%" & varfind & "%'"
End Select

and this is the result.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/jobs/results.asp, line 24


Browser Type:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2)

it does this in either case.

 
Old June 19th, 2006, 05:06 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Looks like you need some more information before the LIKE.

Something like:

Code:
sqltext = sqltext & " AND [Column Name] LIKE '%" & varfind & "%'"
Best thing to do is put this code on your page and post the results here.

Code:
Response.Write "<br>This is sqltext: " & sqltext
Response.End







Similar Threads
Thread Thread Starter Forum Replies Last Post
Select row in GridView WITHOUT using Select button rao965 ASP.NET 2.0 Professional 1 February 15th, 2008 10:44 AM
Problems with Select & Where statement sharon5469 ASP.NET 1.0 and 1.1 Basics 3 June 11th, 2007 07:09 PM
(Resolved) Select top10 problems jrogers SQL Language 1 April 12th, 2006 09:34 AM
Problems with SELECT DISTINCT dparsons SQL Server 2000 2 April 2nd, 2006 03:55 PM
Fill select box and select recordset value markd Classic ASP Databases 1 February 20th, 2006 06:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.