object is closed?

Results 1 to 2 of 2

Thread: object is closed?

  1. #1
    Join Date
    Dec 1969

    Default object is closed?

    Hi.<BR><BR>I have a problem with grabbing data through one of my stored procedures in sql server 2000. I&#039;m using the following function to return an array from my procedures:<BR><BR>public function returnArray(proc,UID,PW)<BR> <BR> dim con1, strConn, arr, handler<BR> <BR> set con1 = Server.CreateObject("ADODB.Connection")<BR> strConn = "DSN=labdata;UID=" & UID & ";PWD=" & PW<BR> <BR> con1.Open strConn<BR> <BR> arr = con1.execute("EXEC " & proc).GetRows<BR> set con1 = nothing<BR> if isArray(arr) then<BR> returnArray=arr<BR> end if<BR> <BR>end function<BR><BR>This seems to be working fine for all my other stored procedures. Here&#039;s the syntax of my problem procedure:<BR><BR>CREATE PROCEDURE sp_returnDeadPool (@order as varchar(15)) AS<BR><BR>if (@order=&#039;serial&#039;)<BR>begin<BR>select * from tbl_deadPool order by fld_serial;<BR>end<BR>else<BR>if (@order=&#039;description&#039;)<BR>begin<BR>selec t * from tbl_deadPool order by fld_description;<BR>end<BR>else<BR>if (@order=&#039;date&#039;)<BR>begin<BR>select * from tbl_deadPool order by fld_dateAdded;<BR>end<BR>else<BR>if (@order=&#039;state&#039;)<BR>begin<BR>select * from tbl_deadPool order by fld_state;<BR>end<BR><BR>GO<BR><BR>When I try to run this procedure, I get the following error:<BR><BR>"Operation is not allowed when the object is closed."<BR><BR>I&#039;ve looked around a few sites, and this seems to be a regular problem, but I can&#039;t seem to find anything that is applicable to what I&#039;m trying to do. <BR><BR>Any help would be appreciated.<BR><BR>Pete.

  2. #2
    Join Date
    Dec 1969

    Default RE: object is closed?

    I would not have bothered with a SP for this<BR><BR>select * from tbl_deadPool order by fld_" & order <BR><BR>Would work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts