hello
i'm trying to get the recordset of access table but from some reason
it doesnt work
there are 2 files in use:
1.to place the search
2.giving the raw data

from some reason the second stage is not working
this is the code

1.
<HTML>
<BODY>
<H1>Biblio DataBase Search</H1><HR>
<FORM ACTION=DBSEARCH.ASP METHOD=POST>

Enter Author to search for:
<INPUT TYPE=TEXT NAME=txtsearch size="20">
<INPUT TYPE=SUBMIT VALUE="Begin Search">

</FORM>
</BODY>
</HTML>


2.
<HTML><BODY>
<%
  Dim cn
  Dim rs
  Dim sSQL
  Dim sSearchString

  'GET THE SEARCH STRING FRPM THE FORM
  sSearchString = Request.Form("txtSearch")

  If sSearchString = "" Then
     Response.Write("No search string entered!")
     Response.End
  End If

  'CONNET TO THE DATABASE AND PERFORM THE SEARCH
  Set cn = Server.CreateObject("ADODB.Connection")
  cn.Open "DSN=BIBLIO"

  sSQL = "SELECT * FROM AUTHORS WHERE AUTHOR LIKE "
  sSQL = sSQL & "'" & sSearchString & "%' ORDER BY AUTHOR"

  Set rs = cn.Execute(sSQL)
%>
<TABLE BORDER=1>
<TR>Author's Name</TR>
<%
  'DISPLAY THE RESULTS IN A TABLE
  Do While Not rs.EOF
     Response.Write("<TR><TD>")
     Response.Write rs.Fields("Author")
     Response.Write("<TD></TR>")
  rs.MoveNext
  Loop
  rs.Close
  cn.Close
  Set rs = Nothing
  Set cn = Nothing
%>
</TABLE>
</BODY>
</HTML>

what is wrong?

Reply via email to