How to open an access a mdb file from different domains

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

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" %>
Question by:robrodp
    LVL 19

    Expert Comment

    Hi robrodp,

    Are both domains on the same server?


    Author Comment

    No.... they have different ip's
    LVL 19

    Expert Comment

    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.


    Author Comment

    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

    >>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


    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


    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

    LVL 8

    Assisted Solution

    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

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    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 information …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now