p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Server-Side JScript: Passing a Recordset between functions?


Message #1 by Matt Pollak <mpollak@C...> on Tue, 11 Jul 2000 09:17:21 -0400
I am currently working on building some libraries of functions for my web

site, and was trying to use Server-Side JScript to create objects.  One of

these libraries was (is) going to be a database connection library, and I am

running into problems.



I am trying to write a function that I can call and pass in connection

information (UID, Password, DB, SQL Statement, recordset) that will open a

connection to the specified DB, execute the SQL, populate the recordset,

close the connection and return the recordset.  After a few minutes of this

not working, I found out that when the connection is closing it is going out

of scope and that was causing my problem.  Someone told me that this can be

corrected by setting rs.CursorLocation = adUseClient;  rs.CursorType 

adOpenStatic; and rs.ActiveConnection = Nothing; in order to create a

disconnected recordset.  After including the file that contains those

contants I had no trouble with the first two statements.  However "Nothing"

doesn't appear to be a reserved word, or one with any meaning, in JScript.



My question is this:  What can I do to convert the statement "set

rs.ActiveConnection = Nothing" into JScript?  I tried null, 0, and "" and

none of these worked.  Is there any way around this?  Can anyone help me

out?  



Any help is greatly appreciated,

Matt Pollak


  Return to Index