0
我有一個PDF報表,當你點擊一個表單按鈕時打開。最近我們不得不將數據庫遷移到SQL Server。我在SQL Server中有一個需要一個參數的存儲過程,我試圖從Ms Access前端訪問存儲過程。任何人都知道如何去做這件事。從傳遞查詢的語法到報表的打開代碼。任何幫助將很樂意欣賞。MS Access報告通過查詢傳遞SQL Server的參數
我有一個PDF報表,當你點擊一個表單按鈕時打開。最近我們不得不將數據庫遷移到SQL Server。我在SQL Server中有一個需要一個參數的存儲過程,我試圖從Ms Access前端訪問存儲過程。任何人都知道如何去做這件事。從傳遞查詢的語法到報表的打開代碼。任何幫助將很樂意欣賞。MS Access報告通過查詢傳遞SQL Server的參數
我假設你是不是還在使用預2007訪問.....
Access 2007
On the Create tab, click Query Design in the Other group.
Click Close in the Show Table dialog box without adding any tables or queries.
On the Design tab, click Pass-Through in the Query Type workgroup.
Click Property Sheet in the Show/Hide workgroup to display the property sheet for the query.
In the query property sheet, place the mouse pointer in the
ODBC Connect Str property, and then, click the Build (...) button.
With the ODBC Connect Str property, you specify information about the database to which you want to connect. You can type the connection information, or click Build, and then enter information about the server to which you are connecting.
When you are prompted to save the password in the connection string, click Yes if you want the password and logon name to be stored in the connection string information.
If the query is not the type that returns records, set the ReturnsRecords property to No.
In the SQL Pass-Through Query window, type your pass-through query. For example, the following pass-through query uses the Microsoft SQL Server TOP operator in the SELECT statement to return only the first 25 orders in the Orders table from the sample Northwind database:
SELECT TOP 25 orderid from orders
To run the query, click Run in the Results group on the Design tab. For a SQL pass-through query that returns records, click Datasheet view on the status bar.
If necessary, Microsoft Access prompts you for information about your server database.
[訪問VBA參數在直通查詢到SQL Server](可能的重複https://stackoverflow.com /問題/ 44307844 /訪問VBA的參數中,直通查詢到SQL服務器) – Andre