How to wire ActiveX control events sinks.

D

Dan

I am using ado and the record set ocx. I want to be able to receive
RecordsetChangeComplete events. I am running client side scripts and
want notification if someone else edits the data. The prototype for the
event is :
RecordsetChangeComplete reason,objErr,status,objRs so...
I did this:
function recordchanged(v1,v2,v3,v4)
{
alert("recordset changed");
}
var rs = new ActiveXObject("ADODB.Recordset");
rs.RecordsetChangeComplete=recordchanged;

It does not appear to be working. Can someone tell me how to wire up
the event sink for an activeX control in Javascript. Thanks, Dan
 
J

Jim Ley

I am using ado and the record set ocx. I want to be able to receive
RecordsetChangeComplete events. I am running client side scripts and
want notification if someone else edits the data. The prototype for the
event is :
RecordsetChangeComplete reason,objErr,status,objRs so...
I did this:
function recordchanged(v1,v2,v3,v4)
{
alert("recordset changed");
}
var rs = new ActiveXObject("ADODB.Recordset");
rs.RecordsetChangeComplete=recordchanged;

function rs::RecordsetChangeComplete

Jim.
 
D

Dan

Not sure what you mean but, doing something like
var rs = new ActiveXObject("ADODB.Recordset");
function rs::RecordsetChangeComplete(v1,v2,v3,v4)
{
alert("record changed");
}

this results in an Object expected error? Could you be a little more
specific as I am new to javascript?
 
J

Jim Ley

Not sure what you mean but, doing something like
var rs = new ActiveXObject("ADODB.Recordset");
function rs::RecordsetChangeComplete(v1,v2,v3,v4)
{
alert("record changed");
}

this results in an Object expected error? Could you be a little more
specific as I am new to javascript?

<script>
rs = new ActiveXObject("ADODB.Recordset");
</script>
<script>
function rs::RecordsetChangeComplete(v1,v2,v3,v4)
{
alert("record changed");
}
</script>


(for various reasons which would be apparent if you read the JS spec,
but just trust that the initial creation and the assigning event
handlers need to be in seperate blocks.)

sorry for not mentioning it.

Jim.
 
D

Dan

Thanks for the help. This still doesn't work but it is because ADO
Recordset events cannot be scripted with either javascrip or vbscript.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top