Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Proc's and Recordsets

Status
Not open for further replies.

sshafe

Programmer
Oct 18, 2002
71
US
Is there a way to run a stored procedure and then loop through it's results one-by-one?

My case:

run sp_databases (SQL Server stored procedure to return all database on a server)
Then I want to loop through the results.

So how do you execute a stored procedure with recordsets?

Thanks in advance.

 
Try this;

Set SQLTablesRS = dbconn.Execute("EXEC SP_database")

Then
Do While Not SQLTablesRS.EOF
What ever code you need here
SQLTablesRS.MoveNext
Loop

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top