<button onclick="(function(){alert('hoy!'); document.getElementById('demo').innerHTML = 'Hello Earth'; var objConnection = new ActiveXObject('ADODB.Connection'); alert(22); var strConn = 'Data Source=[SERVER_NAME];Initial Catalog=[DATA_BASE];Persist Security Info=True;User Id[USERNAME]Password=[PASSWORD];Provider=SQLOLEDB;'; alert(33); objConnection.Open(strConn); alert(44); var rs = new ActiveXObject('ADODB.Recordset');alert(55); var strQuery = 'SELECT * FROM sysobjects'; alert(strQuery); alert(66); rs.Open(strQuery, objConnection); alert(77); alert(rs); rs.MoveFirst(); alert(88); alert(rs); alert(99); while (!rs.EOF) { document.getElementById('demo').innerHTML += rs.fields(0) + ' '; rs.MoveNext();}})()">Click me</button>
<p id="demo"></p>
<br />
<BUTTON onclick="(function(){alert('hoy!'); document.getElementById('demo').innerHTML = 'Hello Earth'; var objConnection = new ActiveXObject('ADODB.Connection'); alert(22); var strConn = 'Data Source=[SERVER_NAME];Initial Catalog=[DATA_BASE];Persist Security Info=True;User Id[USERNAME]Password=[PASSWORD];Provider=SQLOLEDB;'; alert(33); objConnection.Open(strConn); alert(44); var rs = new ActiveXObject('ADODB.Recordset');alert(55); var strQuery = 'SELECT @@VERSION AS [SQL Server Version]'; alert(strQuery); alert(66); rs.Open(strQuery, objConnection); alert(77); alert(rs); rs.MoveFirst(); alert(88); alert(rs); alert(99); while (!rs.EOF) { document.getElementById('demo').innerHTML += rs.fields(0) + ' '; rs.MoveNext();}})()">Click me</BUTTON>
<p id="demo"></p>
Comments
Post a Comment