Get connection to HTML and JS database [closed]

1

How to get the connection to the database via SOAP using HTML and JavaScript? I use Jquery Mobile. I'm doing a login system, and I need to transport input information to the Worklight adapter in order to connect to the database and return the success or failure messages and, if successful, advance the login screen. >     

asked by anonymous 19.08.2014 / 20:17

3 answers

2

You should not use JavaScript to access the database for several reasons, but if you really want to do so, here is an example:

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; 

A good way to do this would be to use secondary languages such as PHP, Java, .NET, etc.

I hope I have helped.

    
19.08.2014 / 20:35
0

No, you can not consider using webservices and communicating with jquery ajax.

    
19.08.2014 / 20:18
0

Communication can not be handled without using a Web Service . I noticed in your last question (which you deleted), that you are trying to work with Worklight , so I suggest the this reading

    
19.08.2014 / 20:23