Hi everyone,
I have problem for getting the total number of records (Count) from MS-Access DataBase. I used the below code, any help given would be greatly appreciated. Please find the code below:
Thanks & Regards,Code:function findcrinf() { var globe = null; globe = new SGWorld(); var countree = document.all["countname"].value; alert(countree); var cn = new ActiveXObject("ADODB.Connection"); //Microsoft.ACE.OLEDB.12.0 //Microsoft.Jet.OLEDB.4.0 var strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source = E:\\FramesTemplates\\troupdatabase.mdb;Persist Security Info=False"; cn.Open(strConn); alert(strConn); var eot = "select count(*) from troupinf"; alert(eot.value); var i; for(i=0; i<=eot; i++) { var rs = new ActiveXObject("ADODB.Recordset"); var SQL = "Select * From troupinf where contry ='"+countree+"'"; alert(SQL); var xcord; rs.Open(SQL, cn, 1, 3); xcord = rs.Fields("xcoord").value; alert(xcord); var ycord; ycord = rs.Fields("ycoord").value; alert(ycord); var zcord; zcord = rs.Fields("zcoord").value; alert(zcord); var troupinfo; troupinfo = rs.Fields("tropinfor").value; alert(troupinfo); var dateinf; dateinf = rs.Fields("datetoday").value; alert(dateinf); var timeinf; timeinf = rs.Fields("timetoday").value; alert(timeinf); alert("Record Found"); var labelPos = new SGCoord3D(xcord, ycord, zcord); var label = globe.creator.createLabel(labelPos,"Troop1",troupinfo); globe.root.appendChild(label); globe.navigate.flyTo(label); eot++; } rs.Close(); cn.Close(); }
Sharat


Reply With Quote
Bookmarks