We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

How to open an access a mdb file from different domains

robrodp
robrodp asked
on
Medium Priority
309 Views
Last Modified: 2012-08-13
Hi.

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")
MyCommand.ActiveConnection=MyConnection
MyCommand.CommandType=adCmdText
Sql="select * from respuestas" %>
Comment
Watch Question

Commented:
Hi robrodp,

Are both domains on the same server?

Neal.
robrodpProgrammer

Author

Commented:
No.... they have different ip's

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

Neal.
robrodpProgrammer

Author

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?

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

robrodpProgrammer

Author

Commented:
Ok.

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

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")
Conn.open(ConnStr)


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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
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"
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.