Using Javascript to connect SQL Server database -


i need use javascript read data sql server 2008 database. wrote this:(html page code)

<!doctype html "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>database connect</title> <script type="text/javascript"> function loaddb(){ var connection = new activexobject("adodb.connection");  var connectionstring="data source=ИЛЬЯ-ПК;initial catalog=c:\program files\microsoft sql server\mssql10.mssqlserver\mssql\data\sigma_database.mdf;user id=Илья;password="";provider=sqloledb";  connection.open(connectionstring); var rs = new activexobject("adodb.recordset");  rs.open("select username users", connection); rs.movefirst(); while(!rs.eof) {    document.write(rs.fields(1));    rs.movenext(); }  rs.close(); connection.close();  } </script> </head> <body onload="loaddb()"> <div id="main"></div> </body> </html> 

however, nothing happens! wrong it?there're cyrillic alphabet symbols in connection string, can source of problem?or thing going wrong?

this ie code, , in ie have explicitly allow such thing, see accepted answer here:
activexobject in ie8


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -