Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] RE: Disconnected Recordset
- From: javascript@xxxxxxxxxx (Peter Brunone)
- Subject: [Javascript] RE: Disconnected Recordset
- Date: Mon, 24 Feb 2003 13:14:46 -0600
I'm not sure what the magic word is for that ActiveConnection parameter -- I've never been much of a recordset/cursor man myself -- but you might want to try using the GetRows() method of the recordset to dump it to an array... and then just get rid of the RS entirely. Just a thought... Peter |-----Original Message----- |From: javascript-admin@xxxxxxxxxx [mailto:javascript-admin@xxxxxxxxxx]On |Behalf Of Michael Dougherty |Sent: Monday, February 24, 2003 12:27 PM |To: javascript@xxxxxxxxxx |Subject: [Javascript] RE: Disconnected Recordset | | |the following works fine: |<script type='text/javascript'> | var oCN = new ActiveXObject("ADODB.Connection") ; | var oRS = new ActiveXObject("ADODB.Recordset") ; | | oRS.CursorLocation = 3 ; /* Client-side */ | oRS.CursorType = 3 ; /* Static */ | oRS.LockType = 1 ; /* ReadOnly */ | | oCN.open ("Server=MyServer;Database=MyDB;User=Me;Pwd=MyPwd'") ; | oRS.open ("Select * from MyTable",oCN) ; | | alert( oRS.recordCount ) ; | | oRS.close ; | oCN.close ; |</script> | |What i want to do is this: |<script type='text/javascript'> | var oCN = new ActiveXObject("ADODB.Connection") ; | var oRS = new ActiveXObject("ADODB.Recordset") ; | | oRS.CursorLocation = 3 ; /* Client-side */ | oRS.CursorType = 3 ; /* Static */ | oRS.LockType = 1 ; /* ReadOnly */ | | oCN.open ("Server=MyServer;Database=MyDB;User=Me;Pwd=MyPwd'") ; | oRS.open ("Select * from MyTable",oCN) ; | | oRS.activeConnection = [whatever it takes to disconnect this recordset] ; | | oCN.close ; /* close the connection to the DB */ | | /* use the recordset - possibly leaving it open for a while */ | alert( oRS.recordCount ) ; | | oRS.close ; |</script> | | If you don't set the activeConnection to NULL before closing the oCN |connection object, it will cause the oRS recordset object to also close. | | |> I guess the first question would be, how did you get client-side |>javascript to connect to a database? Once we understand the context, |perhaps we'll be |>able to help more. | | |_______________________________________________ |Javascript mailing list |Javascript@xxxxxxxxxx |https://lists.LaTech.edu/mailman/listinfo/javascript |
- Follow-Ups:
- [Javascript] RE: Disconnected Recordset
- From: Ben Joyce
- [Javascript] RE: Disconnected Recordset
- From: Walter
- [Javascript] RE: Disconnected Recordset
- References:
- [Javascript] RE: Disconnected Recordset
- From: Michael Dougherty
- [Javascript] RE: Disconnected Recordset
- Prev by Date: [Javascript] RE: Disconnected Recordset
- Next by Date: [Javascript] RE: Disconnected Recordset
- Previous by thread: [Javascript] RE: Disconnected Recordset
- Next by thread: [Javascript] RE: Disconnected Recordset
- Index(es):