Sub SQLite実行サンプル()
Set conn = CreateObject("ADODB.Connection") Set cmd = CreateObject("ADODB.Command") Set rec = CreateObject("ADODB.Recordset")
Dim sqlite_drv As String Dim sqlite_db As String sqlite_drv = "SQLite3 ODBC Driver" sqlite_db = "データベースへのフルパス"
conn.Open ConnectionString:="DRIVER=" & sqlite_drv & ";Database=" & sqlite_db cmd.ActiveConnection = conn
Dim sql As String sql = "SQL文"
cmd.CommandText = sql Set rec = cmd.Execute
Do Until rec.EOF rec.MoveNext Loop Set rec = Nothing
conn.Close
End Sub
|