简体   繁体   English

HTML-Javascript连接数据库

[英]HTML - Javascript connection to database

I want to create a small website in HTML / Javascript in our company and I'm trying to upload data to an Access database on the company network, but since I don't have administrator rights, I cannot use PHP, ASP or JSP to make the database connection work at server side. 我想在我们公司中使用HTML / Javascript创建一个小型网站,并且试图将数据上传到公司网络上的Access数据库,但是由于我没有管理员权限,因此无法使用PHP,ASP或JSP使数据库连接在服务器端工作。 I also don't have WAMP running or anything, I merely write an HTML file with some CSS and Javascript, and use the directory structure to display my webpage. 我也没有运行WAMP或其他任何东西,我只是编写带有一些CSS和Javascript的HTML文件,并使用目录结构来显示我的网页。 I don't have permission rights to install programs (roll out exe files) due to the company policy :-(. I'm dieing to use a database though (what can I do without??) and I feel very much blocked right now. I had a great idea in mind for our desk and I tried to avoid the general IT policy, because a development request takes too much time and it may not be delivered exactly the way I want it. 由于公司政策,我没有安装程序(推出exe文件)的权限:-(。我很想使用数据库(我该怎么办而没有??),我感到非常受阻现在,我的办公桌上有个不错的主意,我尽量避免采用通用的IT策略,因为开发请求会花费太多时间,并且可能无法完全按照我的要求交付。

Does anyone have some solutions for me (in whatever language or database)?? 有没有人对我有一些解决方案(无论使用哪种语言或数据库)? This may be totally impossible, I don't know! 我不知道这可能是完全不可能的! I was hoping some genius could provide me a workaround! 我希望天才能够为我提供解决方法! (Or hack the system? ;-) kidding) (或破解系统?;-)开玩笑)

Thanks!! 谢谢!!

You must use some sort of server side programming in order to update a database that lives on the server. 必须使用某种服务器端编程才能更新服务器上存在的数据库。

Javascript runs on the client (browser) and can't do this. Javascript在客户端(浏览器)上运行,无法执行此操作。 Even in the client it will have limitations on what it can do: 即使在客户端中,它在功能上也会受到限制:

  • No connections to a local database (local storage not withstanding) 没有与本地数据库的连接(无法使用本地存储)
  • No way to use the filesystem 无法使用文件系统
  • No control over other applications 无法控制其他应用程序

No way around it. 没办法。

在您的情况下,JavaScript毫无用处。

without using serverside language, you cannot access Database using HTML or Javascript. 如果不使用服务器端语言,则无法使用HTML或Javascript访问数据库。 if you want to access database, you have to use some serverside language. 如果要访问数据库,则必须使用某种服务器端语言。 or else you can use json file or csv or any xml file format to store data and access it via JavaScript. 否则,您可以使用json文件或csv或任何xml文件格式来存储数据并通过JavaScript进行访问。

Maybe you could write to a txt file. 也许您可以写入txt文件。

Javascript is in basic a client side language. Javascript是基本的客户端语言。 So i think it's impossible to create a database connection. 因此,我认为不可能创建数据库连接。

Didn't you people hear of nodeJS? 你们不是听过nodeJS吗? ... You can freely use JavaScript for database connection using node. ...您可以使用节点自由使用JavaScript进行数据库连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM