Tom,
thanks very much. That seems to be like what I need. Is it possible to place that piece of code behind a View in Access?
As Access supports views with parameters, so I wonder, if it's possible to take this parameters, execute the query using VBA and then return the recordset as result of the view.
That would be the thing that would work best for me!
Thanks! Max
"Tom van Stiphout" <tom7744.no.spam[ at ]cox.net> schrieb im Newsbeitrag news:vuejg45m7l1su81c1c9iu667f30vq2ieeh[ at ]4ax.com...
[Quoted Text] > On Thu, 30 Oct 2008 13:16:08 +0100, "Markus Eßmayr" > <essmayr/at/racon-linz.at> wrote: > > Not as a linked table, but you can return the data in an ADO > recordset. Then that recordset can be used to bind a form or report. > For example this calls a scalar function: > Dim rs As ADODB.Recordset > Dim conn As ADODB.Connection > Dim sql As String > Set conn = New ADODB.Connection > conn.Open "Driver={SQL Server Native Client > 10.0};Server=MyServer;Database=MyDB;Trusted_Connection=yes;" > Set rs = New ADODB.Recordset > sql = "select dbo.MyScalarFunction('aaa', 'bbb')" > rs.Open sql, conn, adOpenKeyset, adLockReadOnly > Debug.Print "Function returns " & rs(0) > rs.Close > Set rs = Nothing > Set conn = Nothing > > -Tom. > Microsoft Access MVP > > >>Hello, >> >>is there a way, to use a table-valued function stored in an SQL Server >>database, to get the results into a MS Access database? >>It should also be possible to pass parameters to the function. >> >>As the function is not listed in the linkable table list, I'm not sure how >>to do that. >> >>Is there a way to set up a Module, that uses the existing connection to a >>specific linked table, executes any SQL against it and then returns the >>results as a View in Access? >> >>Thanks very much in advance! >> >>Max >>
|