Showing posts with label mail. Show all posts
Showing posts with label mail. Show all posts

Monday, March 19, 2012

DTS package prob

I wrote next ActiveX script. But it doesn't work. Can somebody tell me what i'm doing wrong. It should retrieve the mail and Assoc-NT-Account, but so far i only get errors?

Another question: should I explicitly write this to a table? If yes, how?

************************************************** ******************** ' Visual Basic ActiveX Script '************************************************* **********************

Function Main() Main = DTSTaskExecResult_Success

strServerName = "**********" set oConn = CreateObject("ADODB.Connection") set oCommand = CreateObject("ADODB.Command") set oRS = CreateObject("ADODB.RecordSet")

oConn.Provider("ADsDSOObject") on error resume next oConn.Properties("User ID") = "*********" oConn.Properties("User Name") = "*******" oConn.Properties("Password")="*********" oConn.Properties("Encrypt Password")= True oConn.Open "Ads Provider"

set oCommand.ActiveConnectection = oConn

strQuery =" Select Assoc-NT-Account, mail from LDAP://servername/o=orgName/ou=OrgUnit where objectClass = 'person' order by cn"

oCommand.CommandText = strQuery oCommand.Properties("Page Size") = 99

set oRS.sort ="cn"

i = 0 While not oRS.eof vObjectClass=oRS.Fields("objectClass") bShow = oRS.Fields("mail") > " " if bShow then oRS.Fields("mail") oRS.Fields("Assoc-NT-Account") End If oRS.MoveNext i=i+1 wend End FunctionCan you tell us what error you're getting?|||Yes, it would help to assess and refer to http://www.sqldts.com for reference on the active-x scripts.|||ActiveX can't create object ADODB :(|||I think you need to register the ActiveX components (OCX) on every workstation. You can download Setup/Install-Maker-Programs which are doing this job for you.

And ensure other PCs have the same version of the MDAC_TYP and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vamsgCantCreateObject.asp for reference.|||He's attempting to run the ActiveX component from an ActiveX Script in a DTS package. If this is running as a job from SQL Server, then you don't need ADO on anything other then the SQL Server, and that should be installed by default. If you're executing the ActiveX Script in a DTS Package directly (as opposed to a job), then you have to have ADO on your desktop, which should also be installed by default.

Godofredo, does it tell you exactly which line it fails on? And I'm assuming your real code does not have the run-on lines as in the example originally posted, am I correct?|||No the run lines are due to formatting when copying the code... sorry for that.

It fails on the | set oRS = CreateObject("ADODB.RecordSet") |- part the part between the two pipes. Is it that what you mean?|||Hmmm...

Try replacing this line:
oConn.Provider("ADsDSOObject")
With this:
oConn.Provider = "ADSDSOObject"

Second, I don't know about the "User Name" property. In my connections to LDAP, I simply use "User ID"

Third, I don't think you need to specify "Ads Provider" when you open the connection. Just leave it as:

oConn.Open

For reference, here's some code I've written for connecting to LDAP. You may find it useful:

'We need to make ADO objects to execute a search against Active Directory
set oConn = CreateObject("ADODB.Connection")
set oCommand = CreateObject("ADODB.Command")
set oRS = CreateObject("ADODB.Recordset")

'We have to use the AD Provider to search against AD using ADO
oConn.Provider = "ADSDSOObject"
oConn.Properties("User ID") = strADUserID 'Username of the account with access to *search* AD
oConn.Properties("Password") = strADPassword 'Password of the above username
oConn.Open 'Open connection to the provider
set oCommand.ActiveConnection = oConn 'Set the active connection

'Execute a SQL query through the AD Provider to the AD server to find our the username that was typed in
'ADNamespace = LDAP: (for AD), WINNT: can also be used to authenticate against a NT Domain
'ADServer = Server or IP to the AD server
'ADBaseDN = What AD container do we start searching from
'objectClass = "user" This tells the search to ignore everything except for "user" objects
'sAMAccountName = This is the user ID we want to find
strQuery= "SELECT distinguishedName FROM '" & strADNamespace & "//" & strADServer & "/" & strADBaseDN & "' WHERE objectClass='user' AND sAMAccountName='" & strUser & "'"
oCommand.CommandText = strQuery
oCommand.Properties("Size Limit") = 1 'We only want one result - and there should be only one.
oCommand.Properties("Timeout") = 30 'Time out if it takes to long
set oRS = oCommand.Execute 'Execute the query

Sunday, March 11, 2012

DTS Package Error

Hi,

I have a DTS Package which creates a text file and then sends that file as an attachment in email using "send mail task".

I can run this package manually but if I schedule this package, its getting failed. Here is the error message

"DTSRun: Loading... DTSRun: Executing... DTSRun OnStart: DTSStep_DTSSendMailTask_1 DTSRun OnError: DTSStep_DTSSendMailTask_1, Error = -2147220352 (80040480) Error string: Logon failed: MapiLogonEx Failed due to MAPI error 273: MAPI Logon failed. Error source: Microsoft Data Transformation Services (DTS) Package Help file: sqldts80.hlp Help context: 1100 Error Detail Records: Error: -2147220352 (80040480); Provider Error: 0 (0) Error string: Logon failed: MapiLogonEx Failed due to MAPI error 273: MAPI Logon failed. Error source: Microsoft Data Transformation Services (DTS) Package Help file: sqldts80.hlp Help context: 1100 DTSRun OnFinish: DTSStep_DTSSendMailTask_1 DTSRun: Package execution complete. Process Exit Code 1. The step failed."

Could you please help me with this issue? I am using SQL Server 2000.

Thanks!Have you enabled the ability to send mail ?|||I enabled mail, but now I am getting different error message

"DTSStep_DTSSendMailTask_2, Error = -2147220352 (80040480) Error string: Logon failed: MapiLogonEx Failed due to MAPI error 273: MAPI Logon failed. Error source: Microsoft Data Transformation Services (DTS) P. The step failed."

Thanks!|||Is sql server agent running ? And have you setup the mail profile within the agent ?

Sunday, February 26, 2012

DTS MAPI profile

I get "Unable to load MAPI profiles" error message in DTS Designer trying to
add "Send Mail" task.
SQLMail has been installed and configured (and tested, it works) on the same
server.
Please help, thank you in advanceWhen in the designer, it's using the current users windows
account and the current users mail profile from the location
or PC where you start up DTS.
Are you opening up the designer while logged onto the server
using the service account or are you doing this from your
PC? If it's from a PC, it doesn't matter what you have setup
on the server.
-Sue
On Fri, 11 Aug 2006 13:54:02 -0700, Leon Shargorodsky
<LeonShargorodsky@.discussions.microsoft.com> wrote:

>I get "Unable to load MAPI profiles" error message in DTS Designer trying t
o
>add "Send Mail" task.
>SQLMail has been installed and configured (and tested, it works) on the sam
e
>server.
>Please help, thank you in advance|||I'm logging on using service account (MSSQLServer and SQLServerAgent run
under this account)
"Sue Hoegemeier" wrote:

> When in the designer, it's using the current users windows
> account and the current users mail profile from the location
> or PC where you start up DTS.
> Are you opening up the designer while logged onto the server
> using the service account or are you doing this from your
> PC? If it's from a PC, it doesn't matter what you have setup
> on the server.
> -Sue
> On Fri, 11 Aug 2006 13:54:02 -0700, Leon Shargorodsky
> <LeonShargorodsky@.discussions.microsoft.com> wrote:
>
>|||If you are logging onto the server directly and logging on
using the service account used by SQL Server and SQL Agent.
And if from here you can see the mail profiles, they have
all been setup, tested and they are working correctly, and
from here you open up the DTS designer and it can't find
profiles when adding a Send Mail task, then I have no idea.
That sounds like a problem with the mail profile itself but
apparently your SQL Mail and SQL Agent Mail are both working
fine. Pretty much all of the typical issues that cause the
error you report as not being applicable so I haven't a
clue. Other than MAPI just is unreliable crap.
-Sue
On Mon, 14 Aug 2006 11:10:02 -0700, Leon Shargorodsky
<LeonShargorodsky@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>I'm logging on using service account (MSSQLServer and SQLServerAgent run
>under this account)
>"Sue Hoegemeier" wrote:
>

DTS MAPI profile

I get "Unable to load MAPI profiles" error message in DTS Designer trying to
add "Send Mail" task.
SQLMail has been installed and configured (and tested, it works) on the same
server.
Please help, thank you in advanceWhen in the designer, it's using the current users windows
account and the current users mail profile from the location
or PC where you start up DTS.
Are you opening up the designer while logged onto the server
using the service account or are you doing this from your
PC? If it's from a PC, it doesn't matter what you have setup
on the server.
-Sue
On Fri, 11 Aug 2006 13:54:02 -0700, Leon Shargorodsky
<LeonShargorodsky@.discussions.microsoft.com> wrote:
>I get "Unable to load MAPI profiles" error message in DTS Designer trying to
>add "Send Mail" task.
>SQLMail has been installed and configured (and tested, it works) on the same
>server.
>Please help, thank you in advance|||I'm logging on using service account (MSSQLServer and SQLServerAgent run
under this account)
"Sue Hoegemeier" wrote:
> When in the designer, it's using the current users windows
> account and the current users mail profile from the location
> or PC where you start up DTS.
> Are you opening up the designer while logged onto the server
> using the service account or are you doing this from your
> PC? If it's from a PC, it doesn't matter what you have setup
> on the server.
> -Sue
> On Fri, 11 Aug 2006 13:54:02 -0700, Leon Shargorodsky
> <LeonShargorodsky@.discussions.microsoft.com> wrote:
> >I get "Unable to load MAPI profiles" error message in DTS Designer trying to
> >add "Send Mail" task.
> >SQLMail has been installed and configured (and tested, it works) on the same
> >server.
> >
> >Please help, thank you in advance
>|||If you are logging onto the server directly and logging on
using the service account used by SQL Server and SQL Agent.
And if from here you can see the mail profiles, they have
all been setup, tested and they are working correctly, and
from here you open up the DTS designer and it can't find
profiles when adding a Send Mail task, then I have no idea.
That sounds like a problem with the mail profile itself but
apparently your SQL Mail and SQL Agent Mail are both working
fine. Pretty much all of the typical issues that cause the
error you report as not being applicable so I haven't a
clue. Other than MAPI just is unreliable crap.
-Sue
On Mon, 14 Aug 2006 11:10:02 -0700, Leon Shargorodsky
<LeonShargorodsky@.discussions.microsoft.com> wrote:
>I'm logging on using service account (MSSQLServer and SQLServerAgent run
>under this account)
>"Sue Hoegemeier" wrote:
>> When in the designer, it's using the current users windows
>> account and the current users mail profile from the location
>> or PC where you start up DTS.
>> Are you opening up the designer while logged onto the server
>> using the service account or are you doing this from your
>> PC? If it's from a PC, it doesn't matter what you have setup
>> on the server.
>> -Sue
>> On Fri, 11 Aug 2006 13:54:02 -0700, Leon Shargorodsky
>> <LeonShargorodsky@.discussions.microsoft.com> wrote:
>> >I get "Unable to load MAPI profiles" error message in DTS Designer trying to
>> >add "Send Mail" task.
>> >SQLMail has been installed and configured (and tested, it works) on the same
>> >server.
>> >
>> >Please help, thank you in advance
>>

DTS Mail task breaks after SQL 2005 uninstall/install

When I try to add a Mail Task in my SQL 2000 DTS, I get a message "Please make sure semmap90.dll is installed. When I try to register that dll using regsrv32.exe, it says the entry point is not found.

Any ideas on how to get my e-mail task back?I should point out that I've installed, uninstalled, and then reinstalled SQL 2005 on this machine.|||DTS is now called SQL Server Integration Services. Could you repost this question in the SSIS forum (http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&SiteID=1)?|||Go to the 80 directory that's installed with SQL Server 2000 -

(\Microsoft SQL Server\80\Tools\Binn)

Rename the semmap.dll file to semmap90.dll|||

I've been looking for that answer for 3 days now - thank you so much DanaDBA!

--Wil

|||I'm messing around with this more and here's what I've found now -

SQL Server 2005 will not open the DTS package unless you install - Microsoft SQL Server 2000 DTS Designer Components

Once I installed this package, I broke SQL Server 2000

completely. Now I can open the DTS package in 2005, but I'm still

getting some buggy issues. And, now when I reinstall SQL Server 2000,

it will not work.

Make sure you make these changes on a test server. I'll post an update after I get re-configured and test some more.

|||

Ok - I have this working on 2000 and 2005, but I went

through some hurdles to get here.

When I installed the Microsoft SQL Server 2000 DTS Designer

Components, I noticed the \80\Tools\Binn directory had both dll files -

semmap.dll and semmap90.dll (both were not there originally). SQL Server 2000

was throwing tons of errors when loading enterprise manager.

I uninstalled the DTS designer components, still had errors.

I uninstalled and then reinstalled SQL Server 2000. It still would not work

until I applied SP4.

SQL Server 2000 is now working again - now for the DTS mail

issue

When trying to open the send mail task in 2000, I got an

error regarding a missing file-

semmap90.rll (RLL) in this directory. -

C:\Program Files\Microsoft SQL

Server\80\Tools\Binn\Resources\1033

This directory had the semmap.rll file, so I made a copy of

it and then renamed it to semmap90.rll. Now this resources folder has

semmap90.rll and semmap.rll. Both are the same exact files, just different

names.

C:\Program Files\Microsoft SQL Server\80\Tools\Binn\

- There should be two dll files in here (semmap.dll and semmap90.dll).

If you do not rename the original semmap.dll to semmap90.dll, prior to

installing the Microsoft SQL Server 2000 DTS Designer Components, you will only

have one of the files (was able to verify this on another system - 2000 SP4,

2005 and the DTS designer components were all installed).

I got this working in a pretty funky way, but it's working.

Not sure at this point what else I may have broken.

Good luck. Email me if you have any questions.

drivkind@.gmail.com

- Dana Rivkind

|||Here's a quick summary of the files and versions I have. Everything still works fine.

I'm running SQL Server 2000, SP4.

This directory needs two DLL's:

C:\Program Files\Microsoft SQL Server\80\Tools\Binn\

semmap.dll - (version 2000.80.2039.0)

semmap90.dll - (version 2000.80.194.0)

This directory needs two RLL's (I made a copy of semmap.rll and named it semmap90.rll):

C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033

semmap.rll - (version 2000.80.194.0)

semmap90.rll - (version 2000.80.194.0)
- Dana|||Thanks! Note you want to Copy (not rename) but this did the trick!

DTS Mail task breaks after SQL 2005 uninstall/install

When I try to add a Mail Task in my SQL 2000 DTS, I get a message "Please make sure semmap90.dll is installed. When I try to register that dll using regsrv32.exe, it says the entry point is not found.

Any ideas on how to get my e-mail task back?I should point out that I've installed, uninstalled, and then reinstalled SQL 2005 on this machine.|||DTS is now called SQL Server Integration Services. Could you repost this question in the SSIS forum (http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&SiteID=1)?|||Go to the 80 directory that's installed with SQL Server 2000 -
(\Microsoft SQL Server\80\Tools\Binn)
Rename the semmap.dll file to semmap90.dll|||

I've been looking for that answer for 3 days now - thank you so much DanaDBA!

--Wil

|||I'm messing around with this more and here's what I've found now -
SQL Server 2005 will not open the DTS package unless you install - Microsoft SQL Server 2000 DTS Designer Components
Once I installed this package, I broke SQL Server 2000 completely. Now I can open the DTS package in 2005, but I'm still getting some buggy issues. And, now when I reinstall SQL Server 2000, it will not work.
Make sure you make these changes on a test server. I'll post an update after I get re-configured and test some more.|||

Ok - I have this working on 2000 and 2005, but I went through some hurdles to get here.

When I installed the Microsoft SQL Server 2000 DTS Designer Components, I noticed the \80\Tools\Binn directory had both dll files - semmap.dll and semmap90.dll (both were not there originally). SQL Server 2000 was throwing tons of errors when loading enterprise manager.

I uninstalled the DTS designer components, still had errors. I uninstalled and then reinstalled SQL Server 2000. It still would not work until I applied SP4.

SQL Server 2000 is now working again - now for the DTS mail issue

When trying to open the send mail task in 2000, I got an error regarding a missing file- semmap90.rll (RLL) in this directory. -
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033
This directory had the semmap.rll file, so I made a copy of it and then renamed it to semmap90.rll. Now this resources folder has semmap90.rll and semmap.rll. Both are the same exact files, just different names.

C:\Program Files\Microsoft SQL Server\80\Tools\Binn\
- There should be two dll files in here (semmap.dll and semmap90.dll). If you do not rename the original semmap.dll to semmap90.dll, prior to installing the Microsoft SQL Server 2000 DTS Designer Components, you will only have one of the files (was able to verify this on another system - 2000 SP4, 2005 and the DTS designer components were all installed).

I got this working in a pretty funky way, but it's working. Not sure at this point what else I may have broken.

Good luck. Email me if you have any questions.

drivkind@.gmail.com

- Dana Rivkind

|||Here's a quick summary of the files and versions I have. Everything still works fine.
I'm running SQL Server 2000, SP4.
This directory needs two DLL's:
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\
semmap.dll - (version 2000.80.2039.0)
semmap90.dll - (version 2000.80.194.0)
This directory needs two RLL's (I made a copy of semmap.rll and named it semmap90.rll):
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033
semmap.rll - (version 2000.80.194.0)
semmap90.rll - (version 2000.80.194.0)

- Dana|||Thanks! Note you want to Copy (not rename) but this did the trick!

DTS Mail task breaks after SQL 2005 uninstall/install

When I try to add a Mail Task in my SQL 2000 DTS, I get a message "Please make sure semmap90.dll is installed. When I try to register that dll using regsrv32.exe, it says the entry point is not found.

Any ideas on how to get my e-mail task back?I should point out that I've installed, uninstalled, and then reinstalled SQL 2005 on this machine.|||DTS is now called SQL Server Integration Services. Could you repost this question in the SSIS forum (http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&SiteID=1)?|||Go to the 80 directory that's installed with SQL Server 2000 -

(\Microsoft SQL Server\80\Tools\Binn)

Rename the semmap.dll file to semmap90.dll|||

I've been looking for that answer for 3 days now - thank you so much DanaDBA!

--Wil

|||I'm messing around with this more and here's what I've found now -

SQL Server 2005 will not open the DTS package unless you install - Microsoft SQL Server 2000 DTS Designer Components

Once I installed this package, I broke SQL Server 2000

completely. Now I can open the DTS package in 2005, but I'm still

getting some buggy issues. And, now when I reinstall SQL Server 2000,

it will not work.

Make sure you make these changes on a test server. I'll post an update after I get re-configured and test some more.

|||

Ok - I have this working on 2000 and 2005, but I went

through some hurdles to get here.

When I installed the Microsoft SQL Server 2000 DTS Designer

Components, I noticed the \80\Tools\Binn directory had both dll files -

semmap.dll and semmap90.dll (both were not there originally). SQL Server 2000

was throwing tons of errors when loading enterprise manager.

I uninstalled the DTS designer components, still had errors.

I uninstalled and then reinstalled SQL Server 2000. It still would not work

until I applied SP4.

SQL Server 2000 is now working again - now for the DTS mail

issue

When trying to open the send mail task in 2000, I got an

error regarding a missing file-

semmap90.rll (RLL) in this directory. -

C:\Program Files\Microsoft SQL

Server\80\Tools\Binn\Resources\1033

This directory had the semmap.rll file, so I made a copy of

it and then renamed it to semmap90.rll. Now this resources folder has

semmap90.rll and semmap.rll. Both are the same exact files, just different

names.

C:\Program Files\Microsoft SQL Server\80\Tools\Binn\

- There should be two dll files in here (semmap.dll and semmap90.dll).

If you do not rename the original semmap.dll to semmap90.dll, prior to

installing the Microsoft SQL Server 2000 DTS Designer Components, you will only

have one of the files (was able to verify this on another system - 2000 SP4,

2005 and the DTS designer components were all installed).

I got this working in a pretty funky way, but it's working.

Not sure at this point what else I may have broken.

Good luck. Email me if you have any questions.

drivkind@.gmail.com

- Dana Rivkind

|||Here's a quick summary of the files and versions I have. Everything still works fine.

I'm running SQL Server 2000, SP4.

This directory needs two DLL's:

C:\Program Files\Microsoft SQL Server\80\Tools\Binn\

semmap.dll - (version 2000.80.2039.0)

semmap90.dll - (version 2000.80.194.0)

This directory needs two RLL's (I made a copy of semmap.rll and named it semmap90.rll):

C:\Program Files\Microsoft SQL Server\80\Tools\Binn\Resources\1033

semmap.rll - (version 2000.80.194.0)

semmap90.rll - (version 2000.80.194.0)
- Dana|||Thanks! Note you want to Copy (not rename) but this did the trick!