July 16, 2018

How To Display the Field Names and Field Values in ASP

freewaredownload.in free ASP SCRIPTS

FREE ASP SCRIPT SOURCE CODE

ASP SCRIPT SOURCE CODE FREE

ASP MS SQL DB CONNECTION STRING

HTML FORM (save as form.html)


<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")
rs.Open "SELECT * FROM Customers", conn

do until rs.EOF
  for each x in rs.Fields
    Response.Write(x.name)
    Response.Write(" = ")
    Response.Write(x.value & "<br />")
  next
  Response.Write("<br />")
  rs.MoveNext
loop

rs.close
conn.close
%>

</body>


DISPLAY FIELD NAMES AND FIELD VALUES IN HTML TABLE (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")
rs.Open "SELECT Companyname, Contactname FROM Customers", conn
%>

<table border="1" width="100%">
<%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]

::