473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

sp_OA* ActiveX problem: reading property works not

Hello to all,

Maybe first small introduction:
- SQLServer 2000 SP3,
- XP Pro EN,
- ActiveX,
- SP in database

It should working like this.
There is a instanse of an object working, which recieves "telegramms"
from all clients, including SQLServer.

In SP I set the special properities (see code below) and it works.
Also works the method, which I call by this object.

The only thing which is not working is, that I cannnot read the object
property, which I try to read!

I was trying already, to do something that the SQL server want
blocking the object, but it is not the case.
Below the code:
---------------------------------------
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
declare @nMessageNr numeric
declare @bstrDateTime varchar(100)
declare @textFromA1 varchar(100)
declare @textFromA2 varchar(100)
declare @i int

set @iObject = 0
set @dDateEVT = getdate()
set @iRetVal = 0
set @sText1 = 'AA00000000'
set @sText2 = 'BB00000000'
set @iProperty = 7
set @i = 0
-- {034188F2-8DBC-4613-829A-76D5279C35A3}
exec @iRetVal = sp_OACreate 'RAIDSSimComponents.pidMessenger',
@iObject OUTPUT,1
IF @iRetVal <> 0
begin
exec sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT
set @sLog = 'LOG1: No object created. Source: ' + @sSource + '
Description: ' + @sDescription
print @sLog
end
-- Set the object property
exec @iRetVal = sp_OASetProperty @iObject, 'FollowFromB', 1
IF @iRetVal <> 0
begin
exec sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT
set @sLog = 'LOG1: Error by setting property FollowFromA'
print @sLog
end

exec @iRetVal = sp_OASetProperty @iObject, 'FollowFromB_EventID', 555
IF @iRetVal <> 0
begin
exec sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT
set @sLog = 'LOG1: Error by setting property FollowFromB'
print @sLog
end

-- Call method
exec @iRetVal = sp_OAMethod @iObject,'SendNotification_FromA',
@iProperty OUT, 555, @dDateEVT, @sText1, @sText2
IF @iRetVal <> 0
begin
exec sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT
set @sLog = 'LOG1: Error by setting property FollowFromA'
print @sLog
end

set @sProperty = '?'
set @i = 1

-- Start the while loop, to give the time that the object set the
property
while @sProperty = '?'
begin

-- Do something to make the object not busy any more
select * from ds_mds_tab
-- Get the property from a object
exec @iRetVal = sp_OAGetProperty @iObject, 'ExtraInfo_FromB',
@sProperty OUT

IF @iRetVal <> 0
begin
exec sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT
set @sLog = 'LOG2: Source: ' + @sSource + ' Description: ' +
@sDescription
print @sLog
end
print @sProperty
-- Write it to the log
exec ds_sp_writetodslogger 'ple', @sProperty

waitfor delay '00:00:01.00'
end

exec sp_OADestroy @iObject
Jul 20 '05 #1
1 1521
Hello,

I forgot to poste one additional information:

if I change the code like this:

-----------------------------------------------------------

while @sProperty = '?'
begin
exec @iRetVal = sp_OAMethod @iObject,'SendNotification_FromA',
@iProperty OUT, 555, @dDateEVT, @sText1, @sText2

exec @iRetVal = sp_OAGetProperty @iObject, 'ExtraInfo_FromB',
@sProperty OUT

IF @iRetVal <> 0
begin
exec sp_OAGetErrorInfo @iObject, @sSource OUT, @sDescription OUT
set @sLog = 'LOG2: Source: ' + @sSource + ' Description: ' +
@sDescription
print @sLog
end
print @sProperty

waitfor delay '00:00:01.00'
end

---------------------------------------------------------------

means,I call the method always before getting the property, after a
while I change the value of property from side of object, I do get
this value!

The problem is, I cannot call the method more then one time. I mean,
it is possible, but this is against the concept of the object.

I must say, that I already posted similar post about the problems with
sp_OA*, but at this Time I did that, there was another problem, and I
solved it by my selfe, with help from you:-)

Thank's in advice

Matik
Jul 20 '05 #2

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

Similar topics

8
by: AnalogKid | last post by:
Short question: What's the difference between SingleUse and MultiUse ? Long question: I've been writing some sample code to see how different Instancing values and threading models work. I...
2
by: Stephanie Stowe | last post by:
Hi. I have never worked on a project that requires IE. So I have done the vast majority of my work server side, delivering cross-browser compliant HTML to the client. I am working on a bug fix to a...
8
by: Bill Ehrreich | last post by:
I'm faced with a situation where I will need to calculate a column for a resultset by calling a component written as a VB6 DLL, passing parameters from the resultset to the component and setting...
0
by: Craig | last post by:
I am having problems getting an ActiveX DLL written in VB6 to call a method in a C# class library component. My C# DLL is called CSharpProject.dll and contains a public class called CSharpClass....
12
by: A.M. | last post by:
Hi at all, how can I do to insert into a HTML page a file .txt stored in the same directory of the server where is the html file that must display the text file.txt? Thank you very much P.Pietro
3
by: Stan | last post by:
Hallo, I have developed an application in MS Access 2000 (Polish version) under MS Windows XP prof (also Polish). Now I would like to run this code on MS Windows XP EN and MS Access XP EN. I have...
2
by: Sunny | last post by:
Hi all, My dev platform: VS .net 2003, win2000pro, office 2000, MOD 2000, C#. Bellow you may read my posting in other group. According that issue, I have dig around and I'm wondering ... My...
5
by: Sagaert Johan | last post by:
hi I have the following problem: I have a C# application that uses an activeX . I installed the application and the NET 1.1 Runtimes on a clean pc When running the application i discover...
0
by: RobKinney1 | last post by:
This is kinda a repost, except I am phrasing the question in a different way since I have a better idea what the problem is now. We are using the DSOFramer (...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.