TEXT SEARCHING DATABASES

Results 1 to 2 of 2

Thread: TEXT SEARCHING DATABASES

  1. #1
    GARY JENKINSON Guest

    Default TEXT SEARCHING DATABASES

    How do I show the results from an SQL database field on an ASP page.<BR><BR>At the moment I am using the following code to show my results, but as of yet I cannot get it to work.<BR><BR>CODE:-Set rst = Server.CreateObject("ADODB.Recordset")<BR>sqlstrin g = "SELECT * FROM [Organisations] WHERE [Organisation] LIKE&#039%" & Request.form("Searching")& "%&#039"<BR><BR>rst.Open sqlstring, Conn, 3, 3<BR><BR><BR>Any help would be very grateful.<BR><BR>Gary J.<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    108

    Default RE: TEXT SEARCHING DATABASES

    Try:<BR><BR>on Error Resume Next <BR>Set conn = CreateObject("adodb.connection")<BR>Conn.open "DSNConnectionString"<BR><BR>sqlstring = "SELECT * FROM Organisations WHERE Organisation=&#039"& Request.form("Searching") &&#039" <BR><BR>SET Rsqlstring = Conn.Execute(sqlstring)<BR><BR>DO WHILE NOT Rsqlstring.EOF<BR> &#039here you can loop through all the records and print<BR> &#039out at the same time by simply doing:<BR><BR> response.write("<BR>Organisation = "&Rsqlstring)<BR>Rsqlstring.MOVENEXT<BR>LOOP<BR><B R>&#039Empty all your objects and close your connection<BR>set Rsqlstring = nothing<BR>Conn.close<BR><BR>Good luck.

Posting Permissions

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