在 VBA db.Execute 字符串中包含括号
Including Parenthisis inside a VBA db.Execute String
如何正确格式化这行代码以允许我在语句字符串中包含括号?
db.Execute("SQL DB", "INSERT INTO ABPCahirMIS.dbo.TESTDB (TEST) VALUES(1) ")
像这样:
Dim dbs As DAO.Database, sql as String
Set dbs = "SQL DB"
sql = INSERT INTO ABPCahirMIS.dbo.TESTDB (TEST) VALUES(1)
dbs.Execute sql, dbFailOnError
在VBA中,如果调用sub,调用时不要加括号,eg:
db.Execute "SQL DB", "INSERT INTO ABPCahirMIS.dbo.TESTDB (TEST) VALUES(1)"
如何正确格式化这行代码以允许我在语句字符串中包含括号?
db.Execute("SQL DB", "INSERT INTO ABPCahirMIS.dbo.TESTDB (TEST) VALUES(1) ")
像这样:
Dim dbs As DAO.Database, sql as String
Set dbs = "SQL DB"
sql = INSERT INTO ABPCahirMIS.dbo.TESTDB (TEST) VALUES(1)
dbs.Execute sql, dbFailOnError
在VBA中,如果调用sub,调用时不要加括号,eg:
db.Execute "SQL DB", "INSERT INTO ABPCahirMIS.dbo.TESTDB (TEST) VALUES(1)"