ASP Functions.....?

Results 1 to 2 of 2

Thread: ASP Functions.....?

  1. #1
    Maged Wahba Guest

    Default ASP Functions.....?

    Hi,<BR>Can I return a RecordSet from ASP function so I can use it in another function or procedure? If yes, How can I do it?<BR><BR>Thanks for help.<BR>

  2. #2
    Jason Miller Guest

    Default Why, Yes!

    You should have an open connection as a global variable...<BR><BR>Function viewRS(sqlIn)<BR> set viewRS = objConn.execute(sqlIn)<BR>end function<BR><BR> openObjConn()<BR> set objRS = viewRS(sqlOut)<BR> &#039 do stuff<BR> objRS.close : set objRS = nothing<BR> closeObjConn()<BR><BR>Note that (if you&#039re just doing a select,) it might be better to have a function like this:<BR><BR>function viewRS(sqlIn)<BR> openObjConn()<BR> set objRS = objConn.execute(sqlIn)<BR> viewRS = objRS.getRows <BR>&#039 Flashes it to an array for ultra-fast access!<BR> objRS.close : set objRS = nothing<BR> closeObjConn()<BR>end function<BR><BR> aRecords = viewRS(sql)<BR><BR>And that&#039s all the more I can say before I try to sell you my COM object to do it for you...

Posting Permissions

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