<script language="JavaScript">
var adoConn = new ActiveXObject("ADODB.Connection");
adoConn.Open("Provider=SQLOLEDB;Server=YourServerName;Database=YourDBName;UID=YourSQLLoginID;PWD=YourSQLLoginPassword");
adoRs = new ActiveXObject("ADODB.RecordSet");
adoRs.Open("SELECT * FROM YourTable",adoConn,1,1);
while ( !adoRs.EOF )
{
for (var i=0; i < adoRs.Fields.Count;i++)
{
alert(adoRs.Fields.item(i).Name + "=" + adoRs.Fields.item(i).Value);
}
adoRs.MoveNext();
}