<%
' 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 tblMixes ORDER BY Pref")
' 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.
%>
| Date | Source | Play | Download | TrackList | Length | File size |
| <%= rstSimple.Fields("Date").Value %> | <%= rstSimple.Fields("Source").Value %> | "> |
"> |
"> |
<%= rstSimple.Fields("Mix_Length").Value %> | <%= rstSimple.Fields("Flie_Size").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!
%>