Thursday, February 17, 2005

Accessing an Access Db using JavaScript

<SCRIPT LANGUAGE="javascript">
var conn = new ActiveXObject("ADODB.Connection");
var connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:/sabe/Sabe.mdb; Persist Security Info=False";

conn.Open(connectionstring);

var rs = new ActiveXObject("ADODB.Recordset");

rs.Open("SELECT [itemname] FROM item", conn);

while(!rs.eof)
{
alert(rs(0));
rs.movenext;
}

rs.close;
conn.close;
</SCRIPT>

No comments: