Jump to content

andysargeant

Members
  • Posts

    2
  • Joined

  • Last visited

andysargeant's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hey,Thanks for your help. It works now, just had to put in some wildcards:'%" & txtSearchItem & "%'Cheers
  2. Hi,I'm trying to create a search form for an online database in order to enable users to search through a list of items.So far I have:<form name="frmSearch" action="foodlist.asp" method="post"><input name="txtSearchItem" type="text"><input type="submit" value="Search"><% Const cs = "..."Dim rsDim txtSearchItemtxtSearchItem = Request.Form("txtSearchItem")Set rs = CreateObject("ADODB.Recordset")rs.Open "SELECT*FROM [Food] WHERE [itemName] LIKE txtSearchItem", csDo Until rs.EOF Response.Write rs.Fields("ItemName").value rs.MoveNextLoopSet rs = Nothing%>I'm pretty sure it's just my syntax on my SQL, I just don't know how to put the variable "txtSearchItem" into the select query.Anyone got any suggestions??ThanksAndy
×
×
  • Create New...