<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="text/JavaScript">
function Myconn(){  

var cn = new ActiveXObject("ADODB.Connection");
            var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = Test.mdb;Persist Security Info=False";
            cn.Open(strConn);
            var rs = new ActiveXObject("ADODB.Recordset");
            var SQL = "select * from Customers";
        rs.Open(SQL, cn);

            while(rs.EOF == false)
            {
    document.Write(rs.Fields(0));[COLOR="Red"]/* This gives an error as Object not defined*/ [/COLOR]
            rs.MoveNext();
            }

            rs.Close();
            cn.Close();              
}

</script>

</head>

<body>
<input type="button" name="Sub" value="display" onclick="Myconn()"/>
/* error shows up here*/
</body>
</html>

the above code works when using alert(rs(0)); instead of document.Write();
i need to know how to display the data that is stored in the recordset..

p.s i cant use ASP as the system has the port 80 disabled by the admin..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.