How to open an access a mdb file from different domains


I have a database.mdb in

I have the path in the machine.

I want to access this database from

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" %>
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi robrodp,

Are both domains on the same server?

robrodpAuthor Commented:
No.... they have different ip's
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.

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

robrodpAuthor Commented:
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?
>>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.

robrodpAuthor Commented:

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?

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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"
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.