| Author |
Topic  |
|
|
AskSQLTeam
Ask SQLTeam Question
USA
0 Posts |
|
|
bubber
Starting Member
1 Posts |
|
|
Anonymous
Starting Member
0 Posts |
|
|
blake
Starting Member
Canada
29 Posts |
Posted - 06/05/2001 : 14:24:23
|
Great article! It's helped me quite a bit. However, I've been racking my brain over how to call an 'Add' method for a collection.
eg: in ASP, you would write:
Set obj = Server.CreateObject("Company.AddressBook") obj.Address.Add "1234 Main Street", "Description" etc...
In a stored procedure, this has eluded me. I've managed to create the object, set/get properties, and call methods but when it comes to calling a method within a collection, I'm stumped. I've tried using sp_OASetProperty with the collection name, the value, and an index but this doesn't work as the collection holds objects rather than simple variants.
Any tips? |
 |
|
|
blake
Starting Member
Canada
29 Posts |
Posted - 06/05/2001 : 22:31:18
|
I have solved the collection problem I was having. The relevant code for this can be found at:
http://www.pstruh.cz/help/usrmgr/sa89.htm
Look at the "Get Users Collection" part.
Aside from that, I've also run into the 255 character limit for method parameters and, so far, haven't found a way around that. |
 |
|
|
blake
Starting Member
Canada
29 Posts |
|
|
bishal
Starting Member
Nepal
1 Posts |
Posted - 09/25/2001 : 07:20:44
|
Check it Out .This is used For Sending Mail using CDONT Object
declare @OLEResult int, @ServerID INT, @UserName varchar(20), @ToM varchar(20), @Bod varchar(20)
select @UserName="Your Email" select @ToM="Destination Email select @Bod="Body Of Ur Mail
EXEC @OLEResult = sp_OACreate 'CDONTS.newmail', @ServerID OUT if @OLEResult<>0 BEGIN PRINT'Error Occured on Creating Object' RETURN END
EXEC @OLEResult = sp_OASetProperty @ServerID,'From', @UserName IF @OLEResult<>0 BEGIN PRINT 'Error Occured On Setting From Property' RETURN END
EXEC @OLEResult = sp_OASetProperty @ServerID,'To', @ToM if @OLEResult<>0 begin print 'Error Occured on Setting To Property' return end
EXEC @OLEResult = sp_OASetProperty @ServerID,'Body', @Bod if @OLEResult<>0 begin print 'Error Occured on Setting the Body' return end
EXEC @OLEResult = sp_OAMethod @ServerID,'Send'
if @OLEResult<>0 begin print 'Error Occured On Calling Send Methods' return end
EXEC @OLEResult = sp_OADestroy @ServerID
|
 |
|
|
qchau_98
Starting Member
6 Posts |
Posted - 07/25/2002 : 11:50:32
|
| SQL Sever 2000 over write the limition of 255 charater in the COM object. |
 |
|
|
mtrein
Starting Member
Brazil
4 Posts |
Posted - 02/03/2005 : 13:01:49
|
Hi, I have a dll written in C. Can I call its methods and fiddle with its attributes from the sql code? How do I do that, can anyone explain? I am totally newb to this, so I need as much detail as possible.
Thanks in advance,
Marcelo |
 |
|
| |
Topic  |
|