Data Access

In this example we want to view the names in Customer.dbf of all customers of Tasmanian Traders, which comes as sample application with Visual FoxPro.

<HTML>

<HEAD>

  <TITLE>All customers of table CUSTOMER</TITLE>

<HEAD>

 

<BODY>

  <h1 color="#0000FF"><% ? "All customers of table CUSTOMER" %></h1>

  <hr>

 

  <table border="1" width="95%">

    <tr bgcolor="#008000">

      <td width="20%">cust_id</td>

      <td width="40%">company</td>

      <td width="40%">contact</td>

    </tr>

    <%

      if not used("customer")

        use File.FullPath("data\customer.dbf") in 0

      endif

 

      select customer

      scan

      <%

      </tr>

        <td><% ? customer.cust_id %></td>

        <td><% ? customer.company %></td>

        <td><% ? customer.contact %></td>

      </tr>

      %>

      endscan

    %>

  </table>

<BODY>

<HTML>