The code below allows us to connect to our Access database called ‘Friends.mdb’ and retrieve all the records from the table ‘tblFriends’. The table has 3 columns, firstly an 'ID' field that is an autonumber, secondly a field called 'FirstName' which is a textfield and lastly another textfield called 'SurName'.
Call our file ‘connection.asp’.
The above code will display the ID number, the Firstname and Surname of all the entries in our database table 'tblFriends'. If there are no entries then the message 'No records returned.' will be displayed.
| Previous: ADO and connecting to a database |
Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.
Get your best asp web hosting provider now and save 25%