none
connect ms access database on a ftp location RRS feed

  • Question


  • I have an access db in a website that i'm trying to connect to and access.

    The connection string looks like this:

    var objConnection = new ActiveXObject("ADODB.Connection");

    objConnection.Open("Provider = Microsoft.Jet.OLEDB.4.0;Data Source = temp.mdb"); 
    this works when it's run on a my local machine with the file path specified like (Data Source = c:\myfolder\temp.mdb).

    however, i like to find out how data source should be referenced in a website? 

    I access my website thru FTP and have the Database sitting in a webroot on ISP 

    But once I execute this on the server, it does not recognize the datasource path.

    objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=\\XXX.XXX.XXX.XXX\webroot\ParentDirectory\App_Data\abc.mdb

    XXX.XXX.XXX.XXX is the IP address where my website is deployed.

    The folder App_Data on the server has all permissions. 

    I tried to google entire day .. but it gave me the same approach Data Source=\\server\\path 

    How do i access the table in that DB.
    Any other idea to do it ?

    thanks.
    Soniya

    Tuesday, March 17, 2009 4:11 PM

Answers

  • As Himanshu has indicated, you need to use UNC path to the file. You can also use a mapped drive letter to the network resource but a UNC path is recommend. In addition, all users connecting to this database must have full permissions to the folder where database file is located.

    If you encounter errors please post what they are so that we can troubleshoot the issue.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, March 18, 2009 12:24 PM

All replies

  • Hi Soniya

    Can you try using the relative path to the database file? For example specifying App_Data\abc.mdb instead of the fully qualified path.

    Thanks
    Himanshu 


    Please remember to mark the replies as answers if they help you.
    Tuesday, March 17, 2009 4:45 PM
  • I have 2 different programs.

    1st program is an exe file in VB6 and 2nd program is a website in .Net using MS Access database

    1st program should change the access database in the 2nd program.

    Both the programs are on different servers.

    The website program is on FTP server. So how do i point my 1st program to the FTP location ?
    In this case relative path will nt work ..

    Tuesday, March 17, 2009 5:05 PM
  • What is the error that you get when you specify the fully qualified path?
    Please remember to mark the replies as answers if they help you.
    Wednesday, March 18, 2009 12:15 AM
  • As Himanshu has indicated, you need to use UNC path to the file. You can also use a mapped drive letter to the network resource but a UNC path is recommend. In addition, all users connecting to this database must have full permissions to the folder where database file is located.

    If you encounter errors please post what they are so that we can troubleshoot the issue.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, March 18, 2009 12:24 PM
  • hello Paul,

    i have the same problem and i think your idea is very great but i don't have any idea about the UNC path. So, can you show me a code example to how to connect to access database on ftp server using ftp server,

    i'm using C#

    thank you in advance

    Wednesday, March 31, 2010 3:06 AM
  • The Access database engine (or Jet) cannot connect to an Access database unless the Data Source is accessible via a file path. That means the file path in the connection string should start with a drive letter (physical drive or mapped drive) or be represented as a UNC path to a network resource (e.g. \\Servername\Sharename\folder\filename.mdb).

    So unless the database location on the FTP server can be representing using a drive letter or UNC path on the network, the Access database engine will not be able to connect to the database file directly.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, March 31, 2010 12:30 PM
  • The Access database engine (or Jet) cannot connect to an Access database unless the Data Source is accessible via a file path. That means the file path in the connection string should start with a drive letter (physical drive or mapped drive) or be represented as a UNC path to a network resource (e.g. \\Servername\Sharename\folder\filename.mdb).

    So unless the database location on the FTP server can be representing using a drive letter or UNC path on the network, the Access database engine will not be able to connect to the database file directly.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, March 31, 2010 12:30 PM
  • Hey Paul,

    I was reading this page and was wondering.. do you know how to tackle this problem in visual C#? I am trying to connect to a MS access database that is on an ftp server. 

    Please advise me!

    Thank you,

    Shashi Dongur

    Friday, June 22, 2012 8:09 PM
  • Connect with web ms access or ms sql server database using vb.net : www.vbcode.somee.com

    Select PCODE (02) And Download Example.

    Monday, December 3, 2012 6:20 PM