Created
February 1, 2017 06:02
-
-
Save dhunmoon/369e4004c600b164f722599aea3366bf to your computer and use it in GitHub Desktop.
JS:ActiveXObject SQL Connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connection = new ActiveXObject("ADODB.Connection") ; | |
var connectionstring="Data Source=<server>;Initial Catalog=<catalog>;User ID=<user>;Password=<password>;Provider=SQLOLEDB"; | |
connection.Open(connectionstring); | |
var rs = new ActiveXObject("ADODB.Recordset"); | |
rs.Open("SELECT * FROM table", connection); | |
rs.MoveFirst | |
while(!rs.eof) | |
{ | |
document.write(rs.fields(1)); | |
rs.movenext; | |
} | |
rs.close; | |
connection.close; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment