If you have any of the records on my wants list available for sale please e-mail me.
<% ' Declare our variables... always good practice! Dim cnnSimple ' ADO connection Dim rstSimple ' ADO recordset ' Create an ADO Connection to connect to the database. ' We're using OLE DB but you could just as easily use ODBC or a DSN. Set cnnSimple = Server.CreateObject("ADODB.Connection") ' We're actually using SQL Server so we use this line instead: cnnSimple.Open "Provider=SQLOLEDB;Data Source=192.168.1.101;" _ & "Initial Catalog=Tunes;User Id=Website_USR;Password=Gu355MiP4%%w0Rd;" _ & "Connect Timeout=15;Network Library=dbmssocn;" ' Execute a query using the connection object. It automatically ' creates and returns a recordset which we store in our variable. Set rstSimple = cnnSimple.Execute("SELECT * FROM tblWants ORDER BY Label") ' Display a table of the data in the recordset. We loop through the ' recordset displaying the fields from the table and using MoveNext ' to increment to the next record. We stop when we reach EOF. %>
<% Do While Not rstSimple.EOF %> <% rstSimple.MoveNext Loop %>
Artist Tune Label Info
<%= rstSimple.Fields("Artist").Value %> <%= rstSimple.Fields("Title").Value %> <%= rstSimple.Fields("Label").Value %> <%= rstSimple.Fields("Info").Value %>
<% ' Close our recordset and connection and dispose of the objects rstSimple.Close Set rstSimple = Nothing cnnSimple.Close Set cnnSimple = Nothing ' That's all folks! %>