title: C# OleDBConnection to Access 2010 - Error: Not a valid filename
body: <p>Thanks for taking the time to read!!!! Sorry I'm a complete Newbie....</p>
  
  <p>So, I'm desperately trying to connect to a database on another computer through a VPN. When I change the code to point to the file locally, there are no problems, but when I try for the networked pc, I get An "unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll", "Additional information: Not a valid file name."</p>
  
  <p>Here's the code, any thoughts would be super appreciated!!!! :)</p>
  
  <pre><code>private void btn_Load_Click(object sender, EventArgs e)
  {
      File.Copy("\\\\User2-pc\\c\\RetailM\\That's Hot\\recent.mdb", "\\\\User2-pc\\c\\PHIL_REPORT_PROGRAM\\That's Hot\\recent_copy.mdb", true);
  
      btn_Load.Text = ("Loaded");
      progressBar1.Value = (100);
  }
  
  private void btnReadAccess_Click(object sender, EventArgs e)
  {
      OleDbConnection conAccess = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\\\User2-pc\\c\\PHIL_REPORT_PROGRAM\\That's Hot\\recent_copy.mdb;Persist Security Info=False;");
  
      string[] strArrays = this.datePickerFrom.Text.Split(new char[] { '/' });
      string[] strArrays1 = this.datePickerTo.Text.Split(new char[] { '/' });
      string[] text = new string[] { "SELECT Barcode,[description],cat1 ,cat2,discount as [Discount],cost_inc as [Price $],DocketLine.quantity as Sold, (rrp * DocketLine.quantity - discount ) as [Rev $], DocketLine.sales_tax as Goods_Tax FROM Docket,DocketLine,Stock WHERE Docket.docket_date &gt;= #", strArrays[1], "/", strArrays[0], "/", strArrays[2], " ", this.timePickerFrom.Text, "# AND Docket.docket_date &lt;= #", strArrays1[1], "/", strArrays1[0], "/", strArrays1[2], " ", this.timePickerTo.Text, "#  and DocketLine.docket_id = Docket.docket_id  and  DocketLine.stock_id= Stock.stock_id" };
      string str = string.Concat(text);
      OleDbDataAdapter daAccess = new OleDbDataAdapter(new OleDbCommand(str, conAccess));
      DataTable dataTable1 = new DataTable();
      daAccess.Fill(dataTable1);
      dgvAccess.DataSource = dataTable1;
  
      decimal num = new decimal(0);
      for (int i = 0; i &lt; this.dgvAccess.Rows.Count; i++)
      {
          num = num + Convert.ToDecimal(this.dgvAccess.Rows[i].Cells[7].Value);
      }
  }
  </code></pre>
  
  <p>Thanks so much for all your time</p>