不能使用 ADODB.Connect 删除 SQLite 数据库中的查询

Can't use ADODB.Connect for delete queries in SQLite Database

我需要删除 SQLite 数据库中的一行,但 ADODB 连接 'Execute' 似乎不起作用。我认为这可能是因为我的查询或者我的语法错误

Dim cn As Object
Set cn = CreateObject("ADODB.Connection")
Dim szlsql AS String


cn.Open "DRIVER=SQLite3 ODBC Driver;Database=C:\mydatabase.db;"
szlsql = "DELETE Table.var " _
                 & " From Table" _
                 & " Where (((TAble.var) = " & "'" & sString & "'" & "))"

cn.Execute (szlsql)

预期的结果是查询有效并且行被删除但只是抛出一条错误消息。这是假设 sString 是一个字符串

尝试:

szlsql = "DELETE From Table Where TAble.var = " & "'" & sString & "'"

cn.Execute szlsql   '<< no need for parentheses here