Store Procedure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I call a stored procedure from Access and make that a records source
for a form or report?
 
Try this
1. Create a passthrough query , empty

run this code:

Dim db As Database , MySet As Recordset , myqs As QueryDef

Set db = CodeDb()
Set myqs = db.QueryDefs("QueryName")
myqs.ReturnsRecords = True
' Define the execute line for the SP
myqs.sql = "DECLARE @R int EXEC SPName select @R "
Set MySet = db.OpenRecordset("QueryName")
If not MySet.Eof then
your code...
end if
 
Back
Top