title: Accessing a SQLite Database in VBA in Excel
body: <p>I have been adding an MS Access database to VBA in order to conduct some analysis of ships. However the database has now changed to SQlite, which I have no idea how to access from VBA. I have tried the use GitHub's SQLiteForExcel, but I don't understand how it works, even with the examples. The code I have for accessing the Access database is below: (the db_path is the hyperlink to my Access database)</p>
  
  <pre class="lang-sql prettyprint-override"><code>Sub query_db()
  
  On Error GoTo Errorhandler
  Dim v_db As DAO.Database
  Dim rst As DAO.Recordset
  Dim vessels_db As Variant
  Dim strSQL As String
  Dim i As Long
  Dim ws As Worksheet
  
  Set ws = Worksheets("results")
  ws.Select
  
  vessels_db = [db_path]
  Set v_db = OpenDatabase(vessels_db)
  
  
  Worksheets("results").Select
  [x_0].Select
  Range(Selection, Selection.Offset(40000, 1)).ClearContents
  
  strSQL = " SELECT Vessels.vsl_name, Vessels.dwt FROM Vessels " &amp; _
            " GROUP BY Vessels.vsl_name, Vessels.dwt ORDER BY Vessels.vsl_name ; "
  Set rst = v_db.OpenRecordset(strSQL)
  ...
  </code></pre>
  
  <p>Does anyone have any idea how I can change this code using SQLiteForExcel so I can access the SQLite database.</p>
  
  <p>Many thanks in advance</p>