Access VBA Parameter in passthrough query to SQL Server

后端 未结 4 1593
情歌与酒
情歌与酒 2020-12-11 10:51

I have several queries in an MS Access database. Some of these use parameters. I use the following code in VBA to provide the query with these parameters:

VB

4条回答
  •  长情又很酷
    2020-12-11 11:33

    If I remember right, in a pass-through query, you are passing the query definition directly to the engine in which it is going to run. So, you will have to use the SQL Server syntax for your query instead of the Access VBA syntax. Give that a try.

    Also, the same goes for a Stored procedure. Use the syntax like you were to execute through SSMS.

    "exec sp_mysp var1 var2" and so on.

提交回复
热议问题