You CAN execute queries using ADO (but I'd agree with Ben that DAO is usually better with any native Access operations).
I created an append query as "qry_test_ADO" in the Access GUI:
[tt]
INSERT INTO applications ( APP_ID, NAME )
VALUES (444, 'a new value');[/tt]
Then here's how to execute using ADO:
[tt]
Sub testADO()
Dim cmd As New ADODB.Command
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "qry_test_ado"
cmd.Execute
End Sub
[/tt]
Here's ASP code I used with parameters. The "rows updated" parameter is an output parameter to get a feedback on success. It's essentially the same in the VBA context. You'll need to do some homework on using parameters because there are a number of approaches, consequences, and bugs involved.
[tt]Sub CheckForReviewUpdate
Dim strMode
Dim strVisitID
Dim Prm_VisitGUID
Dim Prm_RowsUpdated
Dim Cmd_UPDATE
Dim intRowsUpdated
intRowsUpdated = 0
strMode = Request.ServerVariables("REQUEST_METHOD"
If strMode = "GET" Then
'Do nothing
ElseIf strMode = "POST" Then
strVisitID = Request.Form("visit_id"
set Cmd_UPDATE = Server.CreateObject("adodb.command"
Cmd_UPDATE.ActiveConnection = Application("CONN_STRING"

Cmd_UPDATE.CommandType = adCmdStoredProc
Cmd_UPDATE.CommandText = "usp_update_review"
Set Prm_VisitGUID = Cmd_UPDATE.CreateParameter ("@visit_guid",adChar,adParamInput,38,strVisitID)
Cmd_UPDATE.Parameters.Append Prm_VisitGUID
Set Prm_RowsUpdated = Cmd_UPDATE.CreateParameter ("@rows_updated",adTinyInt,adParamOutput,,0)
Cmd_UPDATE.Parameters.Append Prm_RowsUpdated
Cmd_UPDATE.Execute,,adExecuteNoRecords
intRowsUpdated = Cmd_UPDATE.Parameters("@rows_updated"
If intRowsUpdated = 1 Then
Response.Redirect ("list.asp"
Else
Response.Write ("<font color=FF0000 size=2>An error occurred while processing the review update. " & _
"Please try again or contact the administrator if error persists.</font>"
End If
End If
End Sub 'CheckForReviewUpdate[/tt]
Jeffrey R. Roberts
Insight Data Consulting
Access, SQL Server, & Oracle Development