- Local time
- Tomorrow, 03:58
- Joined
- Jan 20, 2009
- Messages
- 12,895
Another technique I have used to connect Access to SQL Server is returning a Table Valued Function via a Pass Through Query.
I needed to pass a parameter to get data from the server then join to other tables. Views don't take parameters and results from Stored Procedures can't be linked. An SP can write to a table but that is pretty clumsy. Access happily joins to the function populated PTQ. The SQL property of the PTQ can be edited to change the parameter.
I also use this technique to populate RowSource tables for comboboxes in Excel.
Code:
SELECT * FROM myTVF(myParameter)
I needed to pass a parameter to get data from the server then join to other tables. Views don't take parameters and results from Stored Procedures can't be linked. An SP can write to a table but that is pretty clumsy. Access happily joins to the function populated PTQ. The SQL property of the PTQ can be edited to change the parameter.
I also use this technique to populate RowSource tables for comboboxes in Excel.