title: Fetching values from sql 2005 using vbscript
body: <p>I am designing a web page that will fetch records for a specific id and print the information.I am just trying to redirect user to other page if provided id does not exists.I tried the below code but when id is null its showing blank page instead of redirecting to desired page.</p>
  
  <p>code:</p>
  
  <pre><code>&lt;% 
  Set conn = Server.CreateObject("ADODB.Connection")
  conn.ConnectionString= "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=eseva;Data Source=BHAGWAT-PC"
  conn.open
  set rs=Server.CreateObject("ADODB.recordset")
  rs.Open "Select * from saat_bara where id='"&amp;request.form("t1")&amp;"'" , conn
  
  if IsNull(rs.Fields("id").Value) then
    response.redirect("end.asp")
  else
    while not rs.eof
      response.Write("Token no:")
      response.Write(rs.fields.item(0))
      response.write("&lt;br&gt;&lt;br&gt;")
  
      response.Write("Name:")
      response.Write(rs.fields.item(1))
      response.write("&lt;br&gt;&lt;br&gt;")
  
      response.Write("Address:")
      response.Write(rs.fields.item(2))
      response.write("&lt;br&gt;&lt;br&gt;")
  
      response.Write("Bdate:")
      response.Write(rs.fields.item(3))
      response.write("&lt;br&gt;&lt;br&gt;")
      rs.movenext
    wend
  end if
  %&gt;
  </code></pre>