Too few parameters. Expected 1 ???

Results 1 to 2 of 2

Thread: Too few parameters. Expected 1 ???

  1. #1
    Join Date
    Dec 1969

    Default Too few parameters. Expected 1 ???

    Can anyone give me a clue as to what is broken in this code:<BR><BR>The querystring is:<BR>index.asp?action=search&type=Architect&sort =Priority&text=contract<BR> <BR><BR>... And here is the code:<BR>&#060;%<BR>sort = Request.QueryString("sort")<BR>%&#062;<BR><BR>&#06 0;%<BR>Param = Request.QueryString("Param")<BR>Data = Request.QueryString("Data")<BR>%&#062;<BR>&#060;%< BR>sql = Request ("sql")<BR>IF sql = "" THEN<BR> sql = "SELECT TblVendors.VendorID, TblVendors.VendorName, TblVendors.Link, TblVendors.ShortDesc, TblVendors.Address, TblVendors.City, TblVendors.State, TblVendors.Zip, TblVendors.Phone, TblVendors.Keywords, TblVendors.Priority, TblVendors.Email, TblVendors.Contact FROM TblVendors WHERE TblVendors.VendorName Like&#039%" & Request("text") & "%&#039 OR TblVendors.Keywords Like&#039%" & Request("text") & "%&#039"<BR> <BR> IF Request("type")&#060;&#062;"" THEN<BR> sql = sql & " AND TblVendors.VendorType LIKE " & Request("type")<BR> END IF<BR> <BR> IF Request("city")&#060;&#062;"" THEN<BR> sql = sql & " AND LIKE &#039%" & Request("city") & "%&#039"<BR> END IF<BR>END IF<BR> <BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR>rs.Open sql, conn, 3, 3<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Too few parameters. Expected 1 ???

    This problem is sometimes caused by miss typing or other small mistakes you have made. Some useful debug methods could be:<BR>1. copy and paste your SQL code into your DB and run it, then you will know the sql statement is correct or not.<BR>2. insert some response.write to see where the problem come out.<BR>Hope this will help.<BR>Thomas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts