1 Reply Latest reply: Dec 20, 2012 6:46 PM by jschellSomeoneStoleMyAlias RSS

    odbc Connection network



      How can I create a network connection to access?

      My connection work in local eg: "c:/..." but not in network "\\server\"
      public void conectar(String caminhoarquivo){
      Properties ppt = new Properties();
      ppt.put("charSet", "ISO-8859-1");
      conexao = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ="+caminhoarquivo, ppt);
      }catch(Exception e){
      JOptionPane.showMessageDialog(null, "o Erro aconteceu na conecção");
      // System.out.println("ERRO na Conexao com o Banco de Dados"+e.toString());

        • 1. Re: odbc Connection network
          972665 wrote:

          How can I create a network connection to access?
          Basically you can't.

          The MS Access odbc driver relies on the file system to access the db file.

          So if you can't open explorer (nothing to do with java) and see the file then neither can the MS Access odbc driver.

          Your options are
          - Expose the file via the file system.
          - Run a proxy application on the remote box (it has file access) and then use a proxy driver from the client app.
          - Use a different database.