sql server 2008 - Return values from a pass-through query via VBA -


i have vba code run query in sql-server 2008. runs fine , displays table need. code here:

set db = currentdb set qdf = db.querydefs("mystoredprocedure")  qdf.sql = "exec [wcns_ops].[dbo].mystoredprocedure [plus bunch of parameters]"    docmd.openquery "mystoredprocedure" 

which displays table:

picture of table stored procedure returns

my question this: how programmatically return these values vba code without displaying table?

the following code untested, should pointed in right direction:

set db = currentdb  set qdf = db.querydefs("mystoredprocedure") qdf.returnsrecords = true qdf.sql = "exec [wcns_ops].[dbo].mystoredprocedure [plus bunch of parameters]"    qdf.openrecordset(dbopensnapshot)  'could dbopendynaset, etc. '     until .eof         debug.print !firstid         debug.print !lastid         .movenext     loop end 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -