473,781 Members | 2,280 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I trap ADO Recordset events in an ASP script (W2K/IIS5)?

Hi.

I'd like to trap ADO Recordset object events in my ASP script (either VBS or JS,
no preference). I've tried (in VBS) writing a Sub rs_RecordChange Complete(
adReason, cRecords, pError, adStatus, pRecordset ) - rs being a server-side
ADODB.Recordset object - but it doesn't get called whenever rs is moved (I
browse it in a loop).

Is there a way to catch those events from ASP?

Thanks for any hint/suggestion.

Vince C.
Jul 19 '05 #1
5 3077
Vince C. wrote:
Hi.

I'd like to trap ADO Recordset object events in my ASP script (either
VBS or JS, no preference). I've tried (in VBS) writing a Sub
rs_RecordChange Complete( adReason, cRecords, pError, adStatus,
pRecordset ) - rs being a server-side ADODB.Recordset object - but it
doesn't get called whenever rs is moved (I browse it in a loop).

Is there a way to catch those events from ASP?

Thanks for any hint/suggestion.

Vince C.


No. There is no way to do this in server-side ASP code.

On client-side, if you use data binding, you will have some builtin events
to use. Please follow up in a client-side code newsgroup (m.p.scripting. * or
one of the groups with dhtml in its name.)

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #2
"Bob Barrows" <re******@NOyah oo.SPAMcom> a écrit dans le message de
news:On******** ******@TK2MSFTN GP09.phx.gbl...
[...]
No. There is no way to do this in server-side ASP code.

On client-side, if you use data binding, you will have some builtin events
to use. Please follow up in a client-side code newsgroup (m.p.scripting. * or
one of the groups with dhtml in its name.)


Thanks, Bob.

I knew I could do this on the client side. Too bad it can't be done sever-side.
Do you know why it is not supported on server side? Is this a security issue or
something else? It's even more sad because both IIS and IE share the same script
engine(s).

Vince C.
Jul 19 '05 #3
Server side is stateless execution so the ASP page won't be there to be able
to respond to the event. If the even t never occurred then the page would
never complete.
You can achieve something similar with a polling technique - call the ASP
page repeatedly (or use XMLHTTP from the client side) to see if the event
has occurred and then handle it from there.
Depends on what event and how you want to 'handle it'.

Chris.

"Vince C." <no**@hotmail.c om> wrote in message
news:OI******** ******@TK2MSFTN GP11.phx.gbl...
"Bob Barrows" <re******@NOyah oo.SPAMcom> a écrit dans le message de
news:On******** ******@TK2MSFTN GP09.phx.gbl...
[...]
No. There is no way to do this in server-side ASP code.

On client-side, if you use data binding, you will have some builtin events
to use. Please follow up in a client-side code newsgroup (m.p.scripting. * or one of the groups with dhtml in its name.)


Thanks, Bob.

I knew I could do this on the client side. Too bad it can't be done
sever-side.
Do you know why it is not supported on server side? Is this a security issue
or
something else? It's even more sad because both IIS and IE share the same
script
engine(s).

Vince C.

Jul 19 '05 #4
Vince C. wrote:
"Bob Barrows" <re******@NOyah oo.SPAMcom> a écrit dans le message de
news:On******** ******@TK2MSFTN GP09.phx.gbl...
[...]
No. There is no way to do this in server-side ASP code.

On client-side, if you use data binding, you will have some builtin
events
to use. Please follow up in a client-side code newsgroup
(m.p.scripting. * or one of the groups with dhtml in its name.)


Thanks, Bob.

I knew I could do this on the client side. Too bad it can't be done
sever-side. Do you know why it is not supported on server side? Is
this a security issue or something else? It's even more sad because
both IIS and IE share the same script engine(s).

Vince C.


It's a limitation of the scripting engine: an object cannot be declared
WithEvents because script variables are variants. In order for a variable to
be defined with events, it has to be defined with a specific object type
when it is declared, in order for the event model to be set up (different
object types have different events, right?). You cannot declare a variant
with events, because the engine has no idea which events might apply.

With client-side code, you have the DOM to work with. The DOM is totally
separate from the script engines.

Anyways, events are intended to be user-driven, not code-driven. It is
assumed that the programmer can write code to call when his code does
something that needs a response.

Sorry,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #5
"Bob Barrows" <re******@NOyah oo.SPAMcom> a écrit dans le message de
news:eJ******** ******@tk2msftn gp13.phx.gbl...
[...]
It's a limitation of the scripting engine: an object cannot be declared
WithEvents because script variables are variants. In order for a variable to
be defined with events, it has to be defined with a specific object type
when it is declared, in order for the event model to be set up (different
object types have different events, right?). You cannot declare a variant
with events, because the engine has no idea which events might apply.

With client-side code, you have the DOM to work with. The DOM is totally
separate from the script engines.
Ok, I see now. So the DOM inside MSIE, for instance, is the one that
automatically binds to events on objects I manipulate in a client script.

Anyways, events are intended to be user-driven, not code-driven. It is
assumed that the programmer can write code to call when his code does
something that needs a response.


That's also right. But my point was the following: if you create a class that
has to manipulate an object, which has events, you should not need to define
events of the same kind on your class. Since ADO Recordset can trigger events
when recordset pointer moves I was hoping I could create a class (actually a
server-side script component) that would not need to care about recordset
events. Now I see it has to.

The events I wanted to trap are related to recordsets, not to my class. This
leads to a syntactical contradiction. But I admit your point in that I should
code it different.

Thanks for your help.

Vince C.
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2769
by: Robin Becker | last post by:
I wonder if this is the right way to write a medusa(asyncore) server with the win32all framework. Other example services seem to create an event to pass the stop signal from SvcStop into a separate termination method, but I'm unsure how that would mix with the polling loop. This simple framework seems to start and stop OK, but I wonder if I'm missing some obvious race or something.
8
15247
by: Hung Huynh | last post by:
Hi, I'm trying to use either one of these methods to position the cursor in a specific position inside a recordset, but neither one seems to work. For example, I have 10 records in my rsData recordset, and I issue this command rsData.Move 5, 1 'move to #5 from beginning
0
1976
by: wsj | last post by:
Hi, I am trying to pass some information via HTTP header from Tomcat server to IIS5(win2K server Traditional Chinese version). Unfortunately, all the Chinese characters are crippled on the ASP page. Can anyone please point me a way for solving this? Thanks Also, one odd thing I experienced is that server running English version of w2K turns out to be fine on decoding Chinese characters...
4
1258
by: s_m_b | last post by:
Can't figure this one. web page with vbscript asp, w2k/iis5 The page opens with no errors (syntax errors get picked up just fine) but. If a line contains a variable that's either not dimmed, or has no value, or returns a bad value from say instr(), the line is simply ignored, or if its inside a loop or for/next, that block is ignored. any ideas?
3
4075
by: Detlev Ahlgrimm | last post by:
Hi! I have to use MS-Access2000 as a frontend for an oracle database. And I dont want to see these ORA-xxxx Popups if an error occures. So I use something like the following in access (it should work with sql-server....): Private Sub Form_Error(DataErr As Integer, Response As Integer) Dim errX As DAO.Error
5
2360
by: Ken Barrett | last post by:
I apologize in advance for cross-posting, but I have noted that others have experienced similar issues and was hoping that someone could help. Briefly, I am working on an ASP.NET content management application written in C#. running on .NET Framework 1.1/W2K/IIS5. The application uses the Microsoft WebService Behavior to generate a tree of "folders" in a frame on the left hand side. The user can click on a "folder", and the contents...
1
1249
by: Luis Esteban Valencia Muñoz | last post by:
Hello, my customer has w2k with iis5. My boss says that I have to developer with vs.net 2002 because they have that configuration. He is not an expert as me so I think he is wrong. The an THe answer I gave to him is the only thing the customer needs is FrameWork 1.1 and that I can work on my office with vs.net 2003 and then generate a setup proyect, than I would bring that setup file to the customer server and execute it independently...
36
4483
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a dataview with a count = 0. Can someone explain why and how I might work around this problem? Here is the code for my function: Public Shared Function GetViewFromRS(ByVal pRS As ADODB.Recordset) _ As DataView
0
1761
by: johntech | last post by:
I have a stand alone w2k machine running IIS5.0. I have a gif of an exploded machine assembly with hot spots of each individule piece on the diagram. When I click on an individule part, I have an ASP program run to access a MS Access database to display a popup box with all the information about that part. It took a while for me to get it up and running. Now after 4 months of flawless running something has gotten changed in the system, no one...
0
10139
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9931
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.