title: Java - DriverManager.getConnection Access
body: <p>i have the following code to test a link to a access database on a new server, everything works with the existing server and i am able to access the folder. !if.exists returns true and i can open the data base using Runtime.getRuntime().exec("run......... + f); so i know it can see the database. im unable to get a reason for the fail but its 100% failing at Connection conn = de..... </p>
  
  <p>can anyone help me.</p>
  
  <p>running gives following output - Java result: -1073741811</p>
  
  <pre><code>package testing;
  
  import connections.LocalProperties;
  import java.io.File;
  import java.io.IOException;
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.SQLException;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  public class NewClass {
  
      public static void main(String[] args) {
          try {
              File f = new File("\\\\***\\***\\****\\***.accdb");
  
  
              if (!f.exists()) {
                  System.out.println("file does not exist" + f.getAbsolutePath());
                  return;
              } else {
                  System.out.println("file does exist" + f.getAbsolutePath());
              }
  
              String url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" + f.getAbsolutePath();
  
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String m_URLString = url;
              String m_UserName = System.getProperty("user.name");
              String m_Password = "*******";
  
              Connection conn = DriverManager.getConnection(m_URLString, m_UserName, m_Password);
              conn.close();
          } catch (SQLException ex) {
              Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
          }
      }
  }
  </code></pre>
  
  <p>When running i get the following popups:
  Java.exe
  If you were in the middle of something, the information might be lost, for more information click here</p>
  
  <p>Error signature </p>
  
  <p>App name:java.exe appver 7.0.30.5 modname:msvcr80.dll</p>