title: Connect to Sqlite Database using VBA
body: <p>My VBA code to connect to the Sqlite Database</p>
  
  <pre class="lang-vb prettyprint-override"><code>Sub LoadValues()
  
     Dim conn As Object, rst As Object
  
     Set conn = CreateObject("ADODB.Connection")
     Set rst = CreateObject("ADODB.Recordset")
  
    ' OPEN CONNECTION
    'Am getting Error at this line
     conn.Open "DRIVER={Microsoft.ACE.OLEDB.12.0 (*.db,   *.accdb)};DBQ=E:\VBA_Project_Demo\Demo\demo.db;"
  
  
    strSQL = "SELECT * FROM test "
  
    ' OPEN RECORDSET
     rst.Open strSQL, conn
  
     ' OUTPUT TO WORKSHEET
     Worksheets("results").Range("A1").CopyFromRecordset rst
     rst.Close
  
    ' FREE RESOURCES
   Set rst = Nothing: Set conn = Nothing
  
  End Sub
  </code></pre>
  
  <p>The error message while executing<br>
  <a href="https://i.stack.imgur.com/gKxZA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gKxZA.jpg" alt="enter image description here"></a></p>
  
  <p>Control Panel ODBC Link<br>
  <a href="https://i.stack.imgur.com/TS0lv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TS0lv.jpg" alt="enter image description here"></a></p>