I am newbie in javascript. My client need an html page which directly query the sql server database and display the result(without using server side scripting). Since this is only used in intranet, he is not bothered much about security. I googled and found some code, but not working.

What browser are you testing that in? ActiveX controls will only work in IE.

NB. I may well be preaching to the converted, but it's worth saying anyway: putting your database manipulation code into client-side javascript is about as bad an idea as it's possible to have. Not only is it awful from a maintenance perspective to have your data model embedded in your presentation code, but you're reliant on JS for data validation - not that you're actually doing any in the code above. And obviously, any developer with half a wit about him who viewed the browser source code could own your intranet server inside a couple of minutes.

tl;dr: Please don't do this; it's a phenomenally bad idea.

kuttan939

11-24-2010, 10:29 AM

Dear Spudhead,

Thanks for your reply

It is true ,this one is a bad idea. But my client is reluctant to run any web server in the server side. Any solution without web server????

Spudhead

11-24-2010, 05:47 PM

I'm assuming you've already got a webserver sitting there since you're serving static html pages off it. And you've clearly got a database server - for all I know, they're on the same machine. The question is not how to create an intranet application without server-side technology. The question is why your client doesn't want to.

kuttan939

11-25-2010, 05:43 AM

The html pages are in local machine. The SQL Server database in on the Network. This is the reason why I mentioned there is no web server