Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-01-16 : 09:56:14
|
| Richard writes "Hi,I am in need of some code that will allow me to create an outlook task against the results returned from the execution of a sql job or stored procedure.I know that you can use the SQL Function SP_OA methods to create external objects however, I have not been able to get this to work. Any help with this would be appreciated, specifically if you have any code examples that I can use.I am running SQL Server 2000 on SP2.Cheers in advance" |
|
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2002-01-16 : 11:20:05
|
| I just used this same link on another post but here goes:[url]http://www.sqlteam.com/item.asp?ItemID=6002[/url] Make sure to download the support files so you have an example to go by.Mike "A program is a device used to convert data into error messages." |
 |
|
|
Onamuji
Aged Yak Warrior
504 Posts |
Posted - 2002-01-16 : 16:36:20
|
| Richard, Wow, you are in luck... I *just* did this. It is friggin hard as crap the way I did it because I needed to support 250+ users. First things first, are you on an NT domain running Exchange? Are you willing to give a single user account access to EVERY mailbox that you want to create a task for? If not you'll have to take the route I did or something simular. This is possible by the way, after hacking up the CDO SDK for a few hours I got something that works 95% of the time, some bugs but its still beta code so I'm not too worried. So here are your solutions: 1) Give access to single domain user to all mailboxes that are to be manipulated. Create COM+ component that interacts with DB and creates task by using a MAPI Session object and creating the task for the user specified by using Logon ProfileInfo:="SERVERNAME" & vbLf & "USERNAME" then manipulating the MAPI objects as needed (easiest solution if you're organization is willing to put in all the work to set up the mailboxes. This is the route I wanted to go but our security guys were like uh uh no way too much maintenance (they're lazy ;-)) 2) Create Outlook COM addin .. this being the OPTIMAL route for requiring user intervention. Option 1 is the only method I know of that can work from a trigger on a remote server. The COM addin simply does exactly what the COM+ component did except it only processes tasks for the current user, GetUserName or something like that API works good. 3) The route I took, create client-side script that interacts with outlook to create the tasks as needed. It's a pretty simple ASP page that the user goes to, specifies some dates to look up and BOOM it creates client side objects for the tasks and then loops through the array and updates as needed. Pretty easy to do but not guarrenteed to work with all computers. You can IM me on AIM (Onamuji) if you'd like the source code for option 3. Those are the only routes I investigated, there may be other better ones and if you come across one let me know will ya!. Our solution was needed because we have a request system that then assigns tasks to users based on MS Project 98 plans stored in a MS Project 98 database. (This is the ugliest database I have seen, 2002 is super sweet compared to this one). So I think this solution will work for anything, its just a generic CreateTask() routine I created in either VBScript or JavaScript ... can't remember which :-p Happy hacking...- Onamuji |
 |
|
|
|
|
|
|
|