[Webinar] Learn how to a build a cloud-first strategyRegister Now


How to open an access a mdb file from different domains

Posted on 2006-03-31
Medium Priority
Last Modified: 2012-08-13

I have a database.mdb in domainx.com

I have the path in the machine.

I want to access this database from domainy.com

Both accept asp. I am using DSN to access from the same domain:

<%Set MyConnection = Server.CreateObject("ADODB.Connection")
MyConnection.Open "DSN=lapalabra"
Set MyCommand = Server.CreateObject("ADODB.Command")
Set MyRecordSet = Server.CreateObject("ADODB.RecordSet")
Sql="select * from respuestas" %>
Question by:robrodp
  • 4
  • 3
LVL 19

Expert Comment

ID: 16343709
Hi robrodp,

Are both domains on the same server?


Author Comment

ID: 16343717
No.... they have different ip's
LVL 19

Expert Comment

ID: 16343850
Are the servers on the same Local Area Network or do they only have internet access between them?

The bottom line is that you need to be able to access the folder that the datbase is located in and you need to have permissions to that folder.  In a LAN or even a WAN this can be accomplished.  Over the Internet you may be able to do this via a VPN or some other method.  

I wouldn't recommend trying to do this over a WAN or VPN as the bandwidth limitation is likely to make your database access very slow.

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 16343950
Access to such mdb's files is not heavy...

I have the path where the mdb file is located, If there is a way I can work through the permissions issues.

What is the required code?
LVL 19

Expert Comment

ID: 16344032
>>I have the path where the mdb file is located

OK, but how are you connected to the remote machine?

You need to give IUSR_machinename  (where machinename is the name of your web server) read/write access to the folder that contains the MDB file.


Author Comment

ID: 16344112

I have one domainx with its IP. I connect to it via DSN

I want to use asp to use the mdb in domainx from domainy. I know it is not possible to do it via DSN, Ijust have the ip and domiany, folder permissions

If the IUSR_machinename  is required what is the code in domainy to access domainx?
LVL 19

Accepted Solution

nschafer earned 1600 total points
ID: 16344204

datapath = path to the mdb file
datafile = name of mdb file
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & datapath & "\" & datafile
set conn = server.createobject("ADODB.Connection")

The path is going to be the hard part here.  It is probably not going to be the same path that is used from domainy.  So lets assume that the server administrator for domainy has setup a share for the folder the mdb file is located in and the share is called data, and of course that your iUSR account has been given appropriate rights to it.

    The path may be \\ipaddress\data


Assisted Solution

NovoNordisk earned 400 total points
ID: 16346643
Use this and make sure the account accessing the DB has modify permissions on both the DB and the directory holding the DB

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\servername\path\file.mdb"

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question