I have doubts, when I tried to set Recordset ActiveConnection property to
null (Active Server Pages) I have the following error:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
I red Jscript reference from AtoZ and nothing. I used Recordset Open()
method with explicit Connection object and SQL command as a Source and like
says ADO API Reference in MSDN, ActiveConnection Should be read/write
property and it is, but it does not accepts null as a value, why I thought
that null (JS) is the same as Nothing (VBS)
Please help
Maciej Warszawski
You are trying to set a property of an object to null, which is
different than setting the variable (object container) to null
(Nothing).
It sounds like the object doesn't allow null as a value for that
property.
----------
Randy Hunt
MCP+I / MCSE
visit www.wshscripting.com
1) Include some VBScript function that returns Nothing:
<%
Function getNothing()
Set getNothing = Nothing
End Function %>
2) Use an MS developer's personal utility:
http://www.netspace.net.au/~torrboy/code/jargutil/
3) My solution: simply get a reference to the default value for an unopened
recordset, which just happens to be Nothing (VT_DISPATCH):
//---- Custom 'Nothing' equivalent for disconnected recordsets ----
var oRS = Server.CreateObject('ADODB.Recordset');
var Nothing = oRS.ActiveConnection;
var oRS = Nothing;
Regards,
Richard
"Maciej Warszawski" <maciej_w...@idg.com.pl> wrote in message
news:OnG$SVfoAHA.1384@tkmsftngp02...
Greets
MW
"Richard A. Lowe" <cha...@YUMSPAMYUMyahoo.com> wrote in message
news:#T9kWfgoAHA.1840@tkmsftngp03...
Why not just do:
rs.Close()
rs = null
I always thought this was the way to clean up a recordset in Jscript.
Have I been "doing it wrong" all this time?
Randy
objRS.ActiveConnection = null; // DOSEN'T WORK
You have to use the methods I've described to disconnect a recordset in
JScript.
(Note that in .NET this isn't supposed to be a prob :)
Richard
"PlaneDoc" <plan...@bizdistrict.com_nospam> wrote in message
news:c03u9tccmjs0m1ujv...@4ax.com...
On Fri, 2 Mar 2001 06:06:37 -0600, "Richard A. Lowe"
<cha...@YUMSPAMYUMyahoo.com> wrote:
>No, you're doing it right.... he was referring to disconnection a recordset
>from a datasource:
>
>objRS.ActiveConnection = null; // DOSEN'T WORK
Doh! I see that now. Oh well, it had been a long day yesterday...
>
>You have to use the methods I've described to disconnect a recordset in
>JScript.
>
>(Note that in .NET this isn't supposed to be a prob :)
Right, since we will all be using ADO.NET and C# <grin>
>Richard
>