p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

asp_databases thread: Stored Procedure Only Returns One Record to ASP

Message #1 by howard@c... on Wed, 26 Dec 2001 19:57:16
I am using following code to return the names of tables in a database on 

SQL Server 2000...

lsTableLayoutSql  = "sp_CR_TableName " 

This is the code in SP:

SELECT SysObjects.Name FROM SysObjects WHERE SysObjects.xType = 'U' ORDER 

BY SysObjects.Name"

Set cnTableLayout = Server.CreateObject("ADODB.Connection")

cnTableLayout.Open lsTableLayoutConn

Set rsTableLayout = cnTableLayout.Execute(lsTableLayoutSql)

'laTableLayout = rsTableLayout.GetRows

response.write rstablelayout(0) & "*"

'For lnRowCntr = 0 To Ubound(laTableLayout,2)

'   Response.write "Table: " & laTablelayout(0,lnRowcntr) & "<BR>"



When I uncomment the getRows line, I get BOF/EOF error...

The response.write for the zeroTh element displays the correct 

entry...However when I try to display rsTableLayour(1)...I get item not 

found in collection error...So, I'm getting the first item, but not the 


The sp runs perfectly when executed through Enterprise Manager...I know 

this is system stuff, but I would think a SELECT would not be hindered, 

only an action query...

Thanks in advance...

  Return to Index