远程连接Access数据库? [英] Connecting Access Databases remotely?

查看:82
本文介绍了远程连接Access数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我有一个Java应用程序,可以执行我想要的所有操作和限制它是它仅驻留在需要工作的本地计算机上".我有位于远程服务器上的Access数据库,并且在远程服务器上安装了Java应用程序,以使用连接字符串 jdbc:odbc:DRIVER = {Microsoft Access Driver(* .mdb)}连接数据库.DBQ = D:\\ DATA \\ DPPI \\ DATA \\ DPPI \\ DPPIPR01.mdb;

Currently I have a Java application which performs all I wanted and the limitation in it is "It only resides on the Local machine for which it needs to work". I have the Access Databases located on a Remote Server and I install the Java app on the remote server to connect the databases using a connection string jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=D:\\DATA\\DPPI\\DATA\\DPPI\\DPPIPR01.mdb;

它连接到Access数据库并使用它们执行所有业务逻辑.

It connects to Access Databases and do all the business logic with them.

增强(有待完成):

  1. 使应用程序在线-不是大问题.
  2. 远程连接数据库-这是唯一需要考虑的问题.

如果我使应用程序联机,则访问数据库需要通过网络(类似于IP或某些网址)进行连接.

If I make the Application Online the Access Databases need to be connecting through network (somewhat like IP or some web address).

问题:

但是经过这个远程连接到Access数据库之后,看来我的要求可以了尚未完成.

But after going through this Connect to Access database remotely It seems my requirement can not be completed.

是否可以将数据库上传到在线虚拟主机服务器并仅从那里访问数据库?如果是,那么我应该如何进行连接,因为Access数据库通过提供包含驱动器号和所有驱动器的完全限定名称进行连接.

Is there any way if I'm able to upload the database to the online web hosting server and access the database from there only? If yes, then how should I do the connectivity since Access Database connects by giving the fully qualified name containing drive letter and all.

但是我应该如何进一步进行操作,以便可以远程连接mdb数据库?

But how should I proceed further so that I may be able to connect the mdb Databases remotely?

ADO解决方案:

但是通过链接后:
http://webcheatsheet.com/ASP/access_connection_strings.php ,看来我们可以执行远程Access数据库连接.

But after going through the link:
http://webcheatsheet.com/ASP/access_connection_strings.php, it seems we can perform remote Access Database connectivity.

ADO的解决方案类似于:

The solution for the ADO is something like:

connectionString ="Provider = MS远程;远程服务器= http://your_remote_server_ip;"&_远程提供程序= Microsoft.Jet.OLEDB.4.0;数据源= c:\ your_database_name.mdb"
connectionString="Provider=MS Remote; Remote Server=http://your_remote_server_ip;" &_ "Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\your_database_name.mdb"

我有点困惑我们如何连接Access数据库.

I'm a tad confused to how Access Database we can connect.

我的脑子里还有一个问题.我正在使用Type-1驱动程序.Type-4驱动程序应支持远程连接吗?

There is one more question in my head. I'm making use of Type-1 Driver. Should the Type-4 Driver support the remote connectivity?

推荐答案

如果您的应用程序是服务器端应用程序(例如Web应用程序),而服务器的操作系统是Windows,则理论上可以使用Access数据库.在这种情况下,Access数据库在您的应用程序本地.在连接字符串中,您只需使用服务器文件系统中Access数据库的路径即可.

If your application is a server side application (like a web application) and your server's OS is Windows then theoretically it is possible to use your Access database. In this scenario, the Access database is local to your application. In your connection string you can simply use the path to the Access database inside your server's file system.

但是请记住,Access是一个桌面数据库,不能用作服务器数据库.这可能会导致性能下降,甚至可能导致系统崩溃.并且此用例可能存在一些许可问题.

But keep in mind, that Access is a desktop database not made to use it as a server database. This can lead to poor performance and maybe system crashes. And it is possible that there are some licencing issues for this use case.

因此,即使可能在服务器应用程序中使用Access,也强烈建议使用真实的服务器数据库,例如MySQL,MS SQL Server等.甚至像Apache Derby或H2这样的嵌入式数据库也将更适合.

So even it may be possible to use Access with a server application it is strongly recommended to use a real server database like MySQL, MS SQL Server, etc. Even an embedded database like Apache Derby or H2 would be a better fit.

如果您的应用程序像胖客户端一样在客户端运行,那么使用Access的唯一机会就是将其放在网络文件系统上,因此每个客户端都可以看到它.但这仅在局域网内有效.如果无法将其放在网络文件系统上,则必须使用真实的服务器数据库.

If your application runs at client side like a fat client, then your only chance to use Access is to put it on a network filesystem, so it is visible from every client. But this works only inside a LAN. If you cannot put it on a network filesystem then you have to use a real server database.

这篇关于远程连接Access数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆