title: Connection to Access 2013 database with VB6
body: <p>I am trying to connect to an Access database 2013 (.accdb) from VB6, and keep getting errors. My code is as follows:</p>
  
  <pre><code>Dim db_file As String
  Dim statement As String
  Dim conn As ADODB.Connection
  Dim rs As ADODB.Recordset
  
  ' Get the data.
  db_file = App.Path
  If Right$(db_file, 1) &lt;&gt; "\" Then db_file = db_file &amp; "\"
  db_file = db_file &amp; "FluidFlo.accdb"
  
  ' Open a connection.
  Set conn = New ADODB.Connection
  conn.ConnectionString = _
      "Provider=Microsoft.ACE.OLEDB.12.0;" &amp; "Data Source=" &amp; db_file &amp; ";" &amp; "Persist Security Info=False"
  conn.Open '(PROBLEM IS HERE)
  
  ' Select the data.
  statement = "SELECT strEmpName FROM tblEmployees ORDER BY strEmpName"
  
  ' Get the records.
  Set rs = conn.Execute(statement, , adCmdText)
  
  ' Load the results into the ComboBox
  Do Until rs.EOF
      cboUsername.AddItem rs!strEmpName
      rs.MoveNext
  Loop
  ' Close the recordset and connection.
  rs.Close
  conn.Close
  </code></pre>
  
  <p>I am trying to load a table in to a combobox in the program, and assuming my connection string is having an error. I changed the <code>Provider=Microsoft.ACE.OLEDB.12.0;</code> to <code>Provider=Microsoft.ACE.OLEDB.15.0;</code> and still no luck. Keep getting an error. </p>
  
  <p>Does anyone have an idea of how to connect to an .accdb database, whether SQL commands or any? Thanks in advance...(pulling my hair out...)</p>