Search notes:
Access Object Model: Database.execute
Database.execute
allows to execute an arbitrary
SQL statement that does not return records, i.e. DML and DDL statements, but not
select statements
Microsoft seems to refer to statements that don't return a result set as
action queries.
option explicit
sub main() ' {
dim sqlStmt as string
sqlStmt = "create table tab_xyz (" & vbcrlf & _
" col_1 integer," & vbcrlf & _
" col_2 integer" & vbcrlf & _
")"
application.currentDB().execute(sqlStmt)
end sub ' }
It probably makes sense to add the optional dbFailOnError
flag in the second parameter:
application.currentDb().execute sqlStmt, dbFailOnError