2

Is it possible to connect to a SQL database, e.g. a SQL Server database, from javascript (client-side). Preferably using an ODBC or OLEDB connection.

I know this normally isn't recommended, and you should always connect from the server-side, but I want people to connect to their own SQL databases on their own local machines.

I have found examples to do this using ActiveX objects, but this only works in Internet Explorer, and I don't want to be restricted by this.

Mohit Kanwar
  • 2,962
  • 7
  • 39
  • 59
Joeri
  • 225
  • 2
  • 10
  • If you want provide users a remote access to their databases - why not do that with a proper DB manager application? – zerkms Jul 30 '15 at 09:09
  • possible duplicate of [How to connect to SQL Server database from JavaScript?](http://stackoverflow.com/questions/857670/how-to-connect-to-sql-server-database-from-javascript) – Shrinivas Shukla Jul 30 '15 at 09:11
  • @Zerkms This is initially a project for myself. I wanted to see if I could replace the default SQL Management Studio client by one in a browser, so I don't need to install it all the time when i need it. Meanwhile learning a bit more about javascript. – Joeri Jul 30 '15 at 09:22

1 Answers1

3

I don't know of any browser-side database drivers, but perhaps check out PostgREST: https://github.com/begriffs/postgrest It wraps PostgreSQL in a simple REST API, so you don't need any additional server software.

ralh
  • 2,514
  • 1
  • 13
  • 19
  • It's not exactly what I need. I'm really searching for a way to call a database from the client-side. But it seems that, except for ActiveX, this is not possible. – Joeri Jul 31 '15 at 07:04