Search code examples
c#ms-accessftpoledb

How to get MS-Access DB online and connect it to C# using oledb


I made a project in Visual Studio 2012 with an accdb database and connected them both, while the accdb file was on my computer. Now I want that the program will be able to read and edit the database from any computer, so I upload the accdb file to ftp server, but when I try to connect it to project, I got an error. How can I connect my project to accdb when it is on ftp server?


Solution

  • I want that the program will be able to read and edit the database from any computer, so I upload the accdb file to ftp server, but when I try to connect it to project, I got an error. How can I connect my project to accdb when it is on ftp server?

    You cannot connect to an .accdb database file using the FTP (or SFTP, or HTTP) protocol. The only way you can connect to an .accdb file is via Windows networking (which uses the SMB protocol). That is, the .accdb file must be accessible to the application using a normal Windows file path, e.g.

    G:\folder\subfolder\example.accdb
    

    or

    \\servername\sharename\folder\subfolder\example.accdb
    

    If you wanted to do that over the Internet you would need to set up some sort of VPN connection to the server where the .accdb file resides. Windows file sharing over the Internet won't work because the ports are routinely blocked by routers and firewalls (and you probably don't want to do that anyway, for performance reasons).

    Of course, your application could use the FTP protocol to download an .accdb file from the server, modify it, and then upload the modified copy, but I suspect that's not what you want.