Hello everyone,
I was wondering. Is it possible, to recive an event from ActiveX into
database?
I was looking alredy with notification services, but I think that's
the wrong way.
Lets say, that there is a ActiveX which realize some tasks.
The database trigers the ActiveX like below:
================================================== =============
declare @iRetVal int
declare @iObject int
declare @sProperty varchar(2560)
declare @sSource varchar(1000)
declare @sDescription varchar(1000)
declare @sLog varchar(1000)
declare @dDateEVT datetime
declare @sText1 varchar(10)
declare @sText2 varchar(10)
declare @iProperty int
set @iObject = 0
set @dDateEVT = getdate()
set @iRetVal = 0
set @sText1 = '0000000000'
set @sText2 = '0000000000'
set @iProperty = 7
exec @iRetVal = sp_OACreate 'MComponent.pidMess', @iObject OUTPUT,1
EXEC sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT
IF @iRetVal <> 0
begin
set @sLog = 'LOG1: No object created. Source: ' + @sSource + '
Description: ' + @sDescription
print @sLog
end
-- Method
exec @iRetVal = sp_OAMethod @iObject,'Send_FromA', @iProperty
OUT,@nMessageNr = 5, @bstrDateTime = @dDateEVT, @textFromA1 = @sText1,
@textFromA2 = @sText2
EXEC sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT
IF @iRetVal <> 0
begin
set @sLog = 'LOG3: Source: ' + @sSource + ' Description: ' +
@sDescription
print @sLog
end
PRINT 'Property from method:'
PRINT @iProperty
================================================== =============
This function works properly. I recive the data into ActiveX.
After the ActiveX process the data, it returns the event, wit a
response for this call of method.
Now ... how do I can get, this event into SQL server?
Is it possible to do that enyhow, without acctions like:
- do, that the ActiveX writes the data in to a interface table, where
from it will be readed.
Any help would be appreciated
Mateusz 3 1513 ma****@sauron.xo.pl (Matik) wrote in message news:<8b**************************@posting.google. com>... Hello everyone,
I was wondering. Is it possible, to recive an event from ActiveX into database? I was looking alredy with notification services, but I think that's the wrong way.
Lets say, that there is a ActiveX which realize some tasks. The database trigers the ActiveX like below:
================================================== =============
declare @iRetVal int declare @iObject int declare @sProperty varchar(2560) declare @sSource varchar(1000) declare @sDescription varchar(1000) declare @sLog varchar(1000) declare @dDateEVT datetime declare @sText1 varchar(10) declare @sText2 varchar(10) declare @iProperty int
set @iObject = 0 set @dDateEVT = getdate() set @iRetVal = 0 set @sText1 = '0000000000' set @sText2 = '0000000000' set @iProperty = 7
exec @iRetVal = sp_OACreate 'MComponent.pidMess', @iObject OUTPUT,1 EXEC sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT IF @iRetVal <> 0 begin set @sLog = 'LOG1: No object created. Source: ' + @sSource + ' Description: ' + @sDescription print @sLog end
-- Method exec @iRetVal = sp_OAMethod @iObject,'Send_FromA', @iProperty OUT,@nMessageNr = 5, @bstrDateTime = @dDateEVT, @textFromA1 = @sText1, @textFromA2 = @sText2 EXEC sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT
IF @iRetVal <> 0 begin set @sLog = 'LOG3: Source: ' + @sSource + ' Description: ' + @sDescription print @sLog end
PRINT 'Property from method:' PRINT @iProperty
================================================== =============
This function works properly. I recive the data into ActiveX. After the ActiveX process the data, it returns the event, wit a response for this call of method.
Now ... how do I can get, this event into SQL server? Is it possible to do that enyhow, without acctions like: - do, that the ActiveX writes the data in to a interface table, where from it will be readed.
Any help would be appreciated
Mateusz
I suspect this is not possible, since Books Online has no information
on event handling with the sp_OA% procedures. You should probably
consider using an external program or script to do what you need,
perhaps scheduled to poll a table on the server at intervals. I know
you mentioned that you're trying to avoid this, so if you need an
alternative approach you might want to give some more details of
exactly what you're trying to do, and why an "interface table" isn't a
good solution in your situation.
Simon
Thank you for reply.
Well... that's the problem. The ActiveX shouldn't be changed any more,
and that's why I have no possibility to implement a function in it,
which writes the data in to interface table. That's why I do not want
such a solution.
I do some algorithm in the database, and in one step, I must 'ask'
ActiveX, for data. This data are the condition for the next steps in the
algorithm from DB.
Now, via sp_OAx procedures, it is possible, to interact with this
ActiveX to give it the data. But the ActiveX do not respond immiedetly,
only via event. It is immposible, to change the ActiveX, that on event,
it writes the data back into DB. I have the solution, that I can have
another program, which catches the event from ActiveX and then writes it
back into DB (or a program which will be called from sp_OAx, and waits
internaly for the ActiveX so long, that as return value can give the
values recived from ActiveX). But these are solutions, which I use
reluctantly.
But anyway ... The solution with table, want be bad, but then I must
have a while loop, til I become answer. I would like not to implement
such a solution.
The best way, as I said, will be, to get the event directly (anyhow) in
to DB, with mechanics and solutions of SQL DB.
Mateusz
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Mateusz Marzec (ma****@sauron.xo.pl) writes: Well... that's the problem. The ActiveX shouldn't be changed any more, and that's why I have no possibility to implement a function in it, which writes the data in to interface table. That's why I do not want such a solution.
I do some algorithm in the database, and in one step, I must 'ask' ActiveX, for data. This data are the condition for the next steps in the algorithm from DB. Now, via sp_OAx procedures, it is possible, to interact with this ActiveX to give it the data. But the ActiveX do not respond immiedetly, only via event. It is immposible, to change the ActiveX, that on event, it writes the data back into DB. I have the solution, that I can have another program, which catches the event from ActiveX and then writes it back into DB (or a program which will be called from sp_OAx, and waits internaly for the ActiveX so long, that as return value can give the values recived from ActiveX). But these are solutions, which I use reluctantly.
An event is essentially a callback, and T-SQL has no mechanism for this.
So if you can't change the COM module, you would have to write a wrapper
that reacts on the callback.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: wang xiaoyu |
last post by:
Hello:
i want use activex in wxpython program,but when i use MakeActiveXClass
an exception occurs.
this is my source code dealing the DICOM ocx.I must note that in this
program "hwtxcontrol" is...
|
by: Newbie |
last post by:
Hi all,
I have some activeX code that I use to get the local computer name. (I don't
think this is possible using ASP from my research).
The rest of my code is ASP. I'd like to know how to...
|
by: jva02 |
last post by:
Hi,
I'm confused why I can capture an event fired by an ActiveX object when
it's loaded via an <object> tag, but not when loaded using "new
ActiveXObject".
Here's a basic example:
vb ActiveX...
|
by: rufus |
last post by:
Hi,
On the project I am working on we need to encapsulate all data and business
logic in an activex dll. My question is: How do I do this? How can I
access the form objects ie text boxes,...
|
by: Peter |
last post by:
I have a VB6 program which can receive Keydown events on an ActiveX control.
The ActiveX control can't fire keydown events so I put a picturebox below
the ActiveX control. I write codes in...
| |
by: Tom Edelbrok |
last post by:
I have a VB6 ActiveX DLL wrapper around a 32-bit DLL (therefore forming my
own totally new DLL). This permits VB.Net to make calls to the new DLL
(whereas VB.Net always failed when making calls to...
|
by: Chad Johnson |
last post by:
I know this question has been asked a million times but I still can't
get an event from an embedded ActiveX Exe to be caught in javascript.
I am able to access all the properties and methods of the...
|
by: Lee |
last post by:
I have an activex control built with VS 2005, C#. I have a "Done"
event that I fire from the control when some processing is done. I
have tested this with a C++ app as the host, and I do get the...
|
by: tuvman |
last post by:
We are developing a web application. Our web app is a heavy client-
our existing .net app exposed as an activex control running in IE. We
need the activex to be able to access our remote database...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |