April 22, 2018

How To Display Selected Data in ASP

freewaredownload.in free ASP SCRIPTS

FREE ASP SCRIPT SOURCE CODE

ASP SCRIPT SOURCE CODE FREE

ASP MS SQL DB CONNECTION STRING

Display only the records from the table that have a “Companyname” that starts with an ‘A'(save as form.asp)



<body>

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/yourdb.mdb"

set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT Companyname, Contactname FROM Customers
WHERE CompanyName LIKE 'A%'"
rs.Open sql, conn
%>

<table border="1" width="100%">
  <tr>
  <%for each x in rs.Fields
    response.write("<th>" & x.name & "</th>")
  next%>
  </tr>
  <%do until rs.EOF%>
    <tr>
    <%for each x in rs.Fields%>
      <td><%Response.Write(x.value)%></td>
    <%next
    rs.MoveNext%>
    </tr>
  <%loop
  rs.close
  conn.close%>
</table>

</body>

Developers Homepage Download Free now

FREE ASP CODE

Description:

SQL

Note: Copy the Source Code to Notepad or any other good Text Editor and save as .asp or .html or .css as the case may be. Give your own file name, if not described in the script.

SQL

RELATED FREEWARES

[catlist id=18]
[catlist id=5]

::