Showing posts with label via. Show all posts
Showing posts with label via. Show all posts

Wednesday, March 7, 2012

help to remove old .bak file

I have an old .bak file that is not being removed via our maitenenance plan
backups. When I try to manually remove it, it says 'file in use'. How do
determine what is holding this file open?
The last time the job ran it failed.
We run daily backups and I see current backups and am able to remove some of
the more recent ones manually.
Take a look at EM - Current Activity to see if the backup step is still
there. Try KILLing it if it is.
HTH
Jerry
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>I have an old .bak file that is not being removed via our maitenenance plan
> backups. When I try to manually remove it, it says 'file in use'. How
> do
> determine what is holding this file open?
> The last time the job ran it failed.
> We run daily backups and I see current backups and am able to remove some
> of
> the more recent ones manually.
|||Thanks for the suggestion, but I already tried that. There was only tran log
going on for different db. I killed it anyway just to make sure and tried to
remove file but still same error. My maintenance window is not until
weekend and I am trying to avoid bouncing server. I can manually clean up
files until then but would prefer if there is another solution. Is there
any what to determine what is holding the file open?
"Jerry Spivey" wrote:

> Take a look at EM - Current Activity to see if the backup step is still
> there. Try KILLing it if it is.
> HTH
> Jerry
> "DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
> news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>
>
|||Depending on how the maint plans are implemented you might check the
Processes tab in Task Manager. Also, do you need to bounce the server or
just the SQL Server/Agent services? Also, why not wait til off-peak hours
to stop - delete the file?
HTH
Jerry
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:10519EF6-CBAE-415D-8CF9-A9FABA3C0EDC@.microsoft.com...[vbcol=seagreen]
> Thanks for the suggestion, but I already tried that. There was only tran
> log
> going on for different db. I killed it anyway just to make sure and tried
> to
> remove file but still same error. My maintenance window is not until
> weekend and I am trying to avoid bouncing server. I can manually clean
> up
> files until then but would prefer if there is another solution. Is
> there
> any what to determine what is holding the file open?
> "Jerry Spivey" wrote:
|||I believe that http://www.sysinternals.com/ has tools for that.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:10519EF6-CBAE-415D-8CF9-A9FABA3C0EDC@.microsoft.com...[vbcol=seagreen]
> Thanks for the suggestion, but I already tried that. There was only tran log
> going on for different db. I killed it anyway just to make sure and tried to
> remove file but still same error. My maintenance window is not until
> weekend and I am trying to avoid bouncing server. I can manually clean up
> files until then but would prefer if there is another solution. Is there
> any what to determine what is holding the file open?
> "Jerry Spivey" wrote:
|||looks at NTHandle from http://www.Sysinternals.com
cheerrs,
Andy
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>I have an old .bak file that is not being removed via our maitenenance plan
> backups. When I try to manually remove it, it says 'file in use'. How
> do
> determine what is holding this file open?
> The last time the job ran it failed.
> We run daily backups and I see current backups and am able to remove some
> of
> the more recent ones manually.

help to remove old .bak file

I have an old .bak file that is not being removed via our maitenenance plan
backups. When I try to manually remove it, it says 'file in use'. How do
determine what is holding this file open?
The last time the job ran it failed.
We run daily backups and I see current backups and am able to remove some of
the more recent ones manually.Take a look at EM - Current Activity to see if the backup step is still
there. Try KILLing it if it is.
HTH
Jerry
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>I have an old .bak file that is not being removed via our maitenenance plan
> backups. When I try to manually remove it, it says 'file in use'. How
> do
> determine what is holding this file open?
> The last time the job ran it failed.
> We run daily backups and I see current backups and am able to remove some
> of
> the more recent ones manually.|||Thanks for the suggestion, but I already tried that. There was only tran lo
g
going on for different db. I killed it anyway just to make sure and tried t
o
remove file but still same error. My maintenance window is not until
weekend and I am trying to avoid bouncing server. I can manually clean up
files until then but would prefer if there is another solution. Is there
any what to determine what is holding the file open?
"Jerry Spivey" wrote:

> Take a look at EM - Current Activity to see if the backup step is still
> there. Try KILLing it if it is.
> HTH
> Jerry
> "DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
> news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>
>|||Depending on how the maint plans are implemented you might check the
Processes tab in Task Manager. Also, do you need to bounce the server or
just the SQL Server/Agent services? Also, why not wait til off-peak hours
to stop - delete the file?
HTH
Jerry
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:10519EF6-CBAE-415D-8CF9-A9FABA3C0EDC@.microsoft.com...[vbcol=seagreen]
> Thanks for the suggestion, but I already tried that. There was only tran
> log
> going on for different db. I killed it anyway just to make sure and tried
> to
> remove file but still same error. My maintenance window is not until
> weekend and I am trying to avoid bouncing server. I can manually clean
> up
> files until then but would prefer if there is another solution. Is
> there
> any what to determine what is holding the file open?
> "Jerry Spivey" wrote:
>|||I believe that http://www.sysinternals.com/ has tools for that.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:10519EF6-CBAE-415D-8CF9-A9FABA3C0EDC@.microsoft.com...[vbcol=seagreen]
> Thanks for the suggestion, but I already tried that. There was only tran
log
> going on for different db. I killed it anyway just to make sure and tried
to
> remove file but still same error. My maintenance window is not until
> weekend and I am trying to avoid bouncing server. I can manually clean u
p
> files until then but would prefer if there is another solution. Is the
re
> any what to determine what is holding the file open?
> "Jerry Spivey" wrote:
>|||looks at NTHandle from http://www.Sysinternals.com
cheerrs,
Andy
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>I have an old .bak file that is not being removed via our maitenenance plan
> backups. When I try to manually remove it, it says 'file in use'. How
> do
> determine what is holding this file open?
> The last time the job ran it failed.
> We run daily backups and I see current backups and am able to remove some
> of
> the more recent ones manually.

help to remove old .bak file

I have an old .bak file that is not being removed via our maitenenance plan
backups. When I try to manually remove it, it says 'file in use'. How do
determine what is holding this file open?
The last time the job ran it failed.
We run daily backups and I see current backups and am able to remove some of
the more recent ones manually.Take a look at EM - Current Activity to see if the backup step is still
there. Try KILLing it if it is.
HTH
Jerry
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>I have an old .bak file that is not being removed via our maitenenance plan
> backups. When I try to manually remove it, it says 'file in use'. How
> do
> determine what is holding this file open?
> The last time the job ran it failed.
> We run daily backups and I see current backups and am able to remove some
> of
> the more recent ones manually.|||Thanks for the suggestion, but I already tried that. There was only tran log
going on for different db. I killed it anyway just to make sure and tried to
remove file but still same error. My maintenance window is not until
weekend and I am trying to avoid bouncing server. I can manually clean up
files until then but would prefer if there is another solution. Is there
any what to determine what is holding the file open?
"Jerry Spivey" wrote:
> Take a look at EM - Current Activity to see if the backup step is still
> there. Try KILLing it if it is.
> HTH
> Jerry
> "DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
> news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
> >I have an old .bak file that is not being removed via our maitenenance plan
> > backups. When I try to manually remove it, it says 'file in use'. How
> > do
> > determine what is holding this file open?
> >
> > The last time the job ran it failed.
> >
> > We run daily backups and I see current backups and am able to remove some
> > of
> > the more recent ones manually.
>
>|||Depending on how the maint plans are implemented you might check the
Processes tab in Task Manager. Also, do you need to bounce the server or
just the SQL Server/Agent services? Also, why not wait til off-peak hours
to stop - delete the file?
HTH
Jerry
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:10519EF6-CBAE-415D-8CF9-A9FABA3C0EDC@.microsoft.com...
> Thanks for the suggestion, but I already tried that. There was only tran
> log
> going on for different db. I killed it anyway just to make sure and tried
> to
> remove file but still same error. My maintenance window is not until
> weekend and I am trying to avoid bouncing server. I can manually clean
> up
> files until then but would prefer if there is another solution. Is
> there
> any what to determine what is holding the file open?
> "Jerry Spivey" wrote:
>> Take a look at EM - Current Activity to see if the backup step is still
>> there. Try KILLing it if it is.
>> HTH
>> Jerry
>> "DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
>> news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>> >I have an old .bak file that is not being removed via our maitenenance
>> >plan
>> > backups. When I try to manually remove it, it says 'file in use'.
>> > How
>> > do
>> > determine what is holding this file open?
>> >
>> > The last time the job ran it failed.
>> >
>> > We run daily backups and I see current backups and am able to remove
>> > some
>> > of
>> > the more recent ones manually.
>>|||I believe that http://www.sysinternals.com/ has tools for that.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:10519EF6-CBAE-415D-8CF9-A9FABA3C0EDC@.microsoft.com...
> Thanks for the suggestion, but I already tried that. There was only tran log
> going on for different db. I killed it anyway just to make sure and tried to
> remove file but still same error. My maintenance window is not until
> weekend and I am trying to avoid bouncing server. I can manually clean up
> files until then but would prefer if there is another solution. Is there
> any what to determine what is holding the file open?
> "Jerry Spivey" wrote:
>> Take a look at EM - Current Activity to see if the backup step is still
>> there. Try KILLing it if it is.
>> HTH
>> Jerry
>> "DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
>> news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>> >I have an old .bak file that is not being removed via our maitenenance plan
>> > backups. When I try to manually remove it, it says 'file in use'. How
>> > do
>> > determine what is holding this file open?
>> >
>> > The last time the job ran it failed.
>> >
>> > We run daily backups and I see current backups and am able to remove some
>> > of
>> > the more recent ones manually.
>>|||looks at NTHandle from http://www.Sysinternals.com
cheerrs,
Andy
"DBAdan" <DBAdan@.discussions.microsoft.com> wrote in message
news:21D38F1A-C470-45BD-B51E-03031A38F4F0@.microsoft.com...
>I have an old .bak file that is not being removed via our maitenenance plan
> backups. When I try to manually remove it, it says 'file in use'. How
> do
> determine what is holding this file open?
> The last time the job ran it failed.
> We run daily backups and I see current backups and am able to remove some
> of
> the more recent ones manually.

Friday, February 24, 2012

Help setting datasource programatiically...

Hi gang...
I have sucessfully created a deployment application for my reports to be
deployed via web services to our customers. However, the only thing I am not
able to set correctly is the shared datasource for the report itself. Below
is a snippet of my code:
/Test/Test is my shared datasource. The curItem object is a catalog item
pointing to a report. The code below does not work - can anyone help me out?
Dim reference As New DataSourceReference
Dim dataSources(0) As DataSource
Dim ds As New DataSource
reference.Reference = "/Test/Test"
ds.Item = CType(reference, DataSourceDefinitionOrReference)
ds.Name = "/Test/Test"
dataSources(0) = ds
rsDeliverTo.SetReportDataSources(curItem.Path, dataSources)
Console.WriteLine("New reference set for the report.")
=-ChrisTry
ds.Name = "Test"
instead of
ds.Name = "/Test/Test"
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Christopher Conner" <someone@.someplace.com> wrote in message
news:u5OXwr3EFHA.3984@.TK2MSFTNGP14.phx.gbl...
> Hi gang...
> I have sucessfully created a deployment application for my reports to be
> deployed via web services to our customers. However, the only thing I am
> not able to set correctly is the shared datasource for the report itself.
> Below is a snippet of my code:
> /Test/Test is my shared datasource. The curItem object is a catalog item
> pointing to a report. The code below does not work - can anyone help me
> out?
> Dim reference As New DataSourceReference
> Dim dataSources(0) As DataSource
> Dim ds As New DataSource
> reference.Reference = "/Test/Test"
> ds.Item = CType(reference, DataSourceDefinitionOrReference)
> ds.Name = "/Test/Test"
> dataSources(0) = ds
> rsDeliverTo.SetReportDataSources(curItem.Path, dataSources)
> Console.WriteLine("New reference set for the report.")
> =-Chris
>|||Lev,
Thanks for the reply. I changed the ds.Name = "Test" and this is the error
I get back:
<Message msrs:ErrorCode="rsDataSourceNotFound"
msrs:HelpLink="http://g
o.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diag
nostics.Utilities.ErrorStrings.resources.Strings&EvtID=rsDataSourceNotFound&
amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=8.00"
x
mlns:msrs="The">http://www.microsoft.com/sql/reportingservices">The data source
'Test' cannot be found in this report.</Message>
</MoreInformation>
<Warnings xmlns="http://www.microsoft.com/sql/reportingservices" />
What is weird is that I *know* that the datasource 'Test' is not in the
report -> as when I upload a report definition, it will not have it - in
this case I am trying to set the datasource connection information for the
report to point to the shared datasource Test...
You know what? Looking at the documentation - It says that the method
SetReportDataSources "Sets the properties that are associated with the data
sources of a specified report." So the method I am using is not going to
work, since my report does not have a report datasource assoicated with it
yet. The documentation says in the remarks section:
Remarks
The report server throws an exception if the SetReportDataSources method is
used to set the data source properties of a linked report. If a data source
that is passed in the DataSources parameter is not associated with the given
report, a SOAP exception is thrown with the error code rsDataSourceNotFound
Which is exactly what I am getting...
I am trying to set my report to use a shared datasource.
The sample in the docuementation for SetReportDataSources does not work.
Do you have any other suggestions Lev?
Do I need to set a report property? This is crazy - I have everything elese
done but setting the datasource information for a report to use a shared
datasource. The report doesn't have any datasources associated with it
because they are invalid when I copied the report from one server to the
other. I can manually set the shared datasource for the report - but it
would be nice to do it via code since I have over 200 reports.
=-Chris
"Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
news:ueFDTi%23EFHA.1292@.TK2MSFTNGP10.phx.gbl...
> Try
> ds.Name = "Test"
> instead of
> ds.Name = "/Test/Test"
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Christopher Conner" <someone@.someplace.com> wrote in message
> news:u5OXwr3EFHA.3984@.TK2MSFTNGP14.phx.gbl...
>> Hi gang...
>> I have sucessfully created a deployment application for my reports to be
>> deployed via web services to our customers. However, the only thing I am
>> not able to set correctly is the shared datasource for the report itself.
>> Below is a snippet of my code:
>> /Test/Test is my shared datasource. The curItem object is a catalog item
>> pointing to a report. The code below does not work - can anyone help me
>> out?
>> Dim reference As New DataSourceReference
>> Dim dataSources(0) As DataSource
>> Dim ds As New DataSource
>> reference.Reference = "/Test/Test"
>> ds.Item = CType(reference, DataSourceDefinitionOrReference)
>> ds.Name = "/Test/Test"
>> dataSources(0) = ds
>> rsDeliverTo.SetReportDataSources(curItem.Path, dataSources)
>> Console.WriteLine("New reference set for the report.")
>> =-Chris
>|||Lev - I figured it out. I have posted the solution above to a newer post of
mine asking if anyone has figured it out. Thanks for trying to help.
=-Chris
"Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
news:ueFDTi%23EFHA.1292@.TK2MSFTNGP10.phx.gbl...
> Try
> ds.Name = "Test"
> instead of
> ds.Name = "/Test/Test"
> --
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> "Christopher Conner" <someone@.someplace.com> wrote in message
> news:u5OXwr3EFHA.3984@.TK2MSFTNGP14.phx.gbl...
>> Hi gang...
>> I have sucessfully created a deployment application for my reports to be
>> deployed via web services to our customers. However, the only thing I am
>> not able to set correctly is the shared datasource for the report itself.
>> Below is a snippet of my code:
>> /Test/Test is my shared datasource. The curItem object is a catalog item
>> pointing to a report. The code below does not work - can anyone help me
>> out?
>> Dim reference As New DataSourceReference
>> Dim dataSources(0) As DataSource
>> Dim ds As New DataSource
>> reference.Reference = "/Test/Test"
>> ds.Item = CType(reference, DataSourceDefinitionOrReference)
>> ds.Name = "/Test/Test"
>> dataSources(0) = ds
>> rsDeliverTo.SetReportDataSources(curItem.Path, dataSources)
>> Console.WriteLine("New reference set for the report.")
>> =-Chris
>|||Chris,
I'll check that sample. It could be doc bug.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Christopher Conner" <someone@.someplace.com> wrote in message
news:%23WfKDmFFFHA.1408@.TK2MSFTNGP10.phx.gbl...
> Lev - I figured it out. I have posted the solution above to a newer post
> of mine asking if anyone has figured it out. Thanks for trying to help.
> =-Chris
> "Lev Semenets [MSFT]" <levs@.microsoft.com> wrote in message
> news:ueFDTi%23EFHA.1292@.TK2MSFTNGP10.phx.gbl...
>> Try
>> ds.Name = "Test"
>> instead of
>> ds.Name = "/Test/Test"
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Christopher Conner" <someone@.someplace.com> wrote in message
>> news:u5OXwr3EFHA.3984@.TK2MSFTNGP14.phx.gbl...
>> Hi gang...
>> I have sucessfully created a deployment application for my reports to be
>> deployed via web services to our customers. However, the only thing I am
>> not able to set correctly is the shared datasource for the report
>> itself. Below is a snippet of my code:
>> /Test/Test is my shared datasource. The curItem object is a catalog item
>> pointing to a report. The code below does not work - can anyone help me
>> out?
>> Dim reference As New DataSourceReference
>> Dim dataSources(0) As DataSource
>> Dim ds As New DataSource
>> reference.Reference = "/Test/Test"
>> ds.Item = CType(reference, DataSourceDefinitionOrReference)
>> ds.Name = "/Test/Test"
>> dataSources(0) = ds
>> rsDeliverTo.SetReportDataSources(curItem.Path, dataSources)
>> Console.WriteLine("New reference set for the report.")
>> =-Chris
>>
>

Help sending email

My code below works fine when run from my pc (changed all the values for
obvious reasons). The code is placed inside a DTS task via VBS scripting.
But when I try to run directly from the server where sqlserver is installed,
the script fails.

I have SMTP running, but there is no outlook installed.

Can someone please advise what I am missing.
Thanks
Bob

Set objEmail = CreateObject("CDO.Message")

objEmail.From = "send@.test.com"
objEmail.To = "receive@.test.com"
objEmail.Subject = "TEST SUBJECT"
objEmail.AddAttachment "\\server\test.csv"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/smtpserver") = "SERVER_NAME"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/smtpauthenticate") = 1
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/sendusername") = "username"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/sendpassword") = "userpwd"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
ration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send

set objEmail = nothingHi B

One thing you might try is change

> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusing") = 2
to
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusing") = "2"

quotes around the 2.

I spent several hours a week ago trying the very same thing and that made
all the difference.

Also is \\server\test.csv accessible from the server you are running this
on?

Here is the full text of the DTS Package I wrote. Note that I don't think
all the fields you included are necessary.

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

Function Main()
email_alert "dchristo@.yahoo.com", "George_Bush@.whitehouse.gov","Test
Subject", "Test Body"
Main = DTSTaskExecResult_Success
End Function

Sub email_alert(strTo, strFrom, strSubject, strBody)
Dim iConf 'As CDO.Configuration
Dim imsg 'As CDO.Message
Dim flds

Set imsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

Set flds = iConf.Fields

'The http://schemas.microsoft.com/cdo/configuration/ namespace defines
the majority of fields used to set configurations for various CDO objects.
We set and update the following three fields (SendUsing, SMTP_SERVER, and
TimeOut) of the Configuration object:

With flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
"2"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp-server.mn.rr.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 10
.Update
End With

Set imsg.Configuration = iConf
imsg.To = strTo
imsg.From = strFrom
imsg.Subject = strSubject
imsg.TextBody = strBody
imsg.AddAttachment "c:\log\myfile.txt"
imsg.Send
End Sub
--
-Dick Christoph

"B" <no_spam@.no_spam.com> wrote in message
news:KsydnTnYtfFV2wbZnZ2dnUVZ_uqdnZ2d@.rcn.net...
> My code below works fine when run from my pc (changed all the values for
> obvious reasons). The code is placed inside a DTS task via VBS scripting.
> But when I try to run directly from the server where sqlserver is
> installed,
> the script fails.
> I have SMTP running, but there is no outlook installed.
> Can someone please advise what I am missing.
> Thanks
> Bob
>
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "send@.test.com"
> objEmail.To = "receive@.test.com"
> objEmail.Subject = "TEST SUBJECT"
> objEmail.AddAttachment "\\server\test.csv"
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusing") = 2
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpserver") = "SERVER_NAME"
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpauthenticate") = 1
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusername") = "username"
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendpassword") = "userpwd"
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpserverport") = 25
> objEmail.Configuration.Fields.Update
> objEmail.Send
> set objEmail = nothing|||Follow-up to my original post below.

Is it possible for the "objEmail.To" to lookup the values from a sqlserver
table?

At the moment, I type the email address separated by a semi-colon.

TIA~

"B" <no_spam@.no_spam.com> wrote in message
news:KsydnTnYtfFV2wbZnZ2dnUVZ_uqdnZ2d@.rcn.net...
> My code below works fine when run from my pc (changed all the values for
> obvious reasons). The code is placed inside a DTS task via VBS scripting.
> But when I try to run directly from the server where sqlserver is
installed,
> the script fails.
> I have SMTP running, but there is no outlook installed.
> Can someone please advise what I am missing.
> Thanks
> Bob
>
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "send@.test.com"
> objEmail.To = "receive@.test.com"
> objEmail.Subject = "TEST SUBJECT"
> objEmail.AddAttachment "\\server\test.csv"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpserver") = "SERVER_NAME"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpauthenticate") = 1
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendusername") = "username"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/sendpassword") = "userpwd"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
> ration/smtpserverport") = 25
> objEmail.Configuration.Fields.Update
> objEmail.Send
> set objEmail = nothing|||Hi B,

Well not directly but you could create an ADODB Command, Connection and
Recordset and use the command to return you a recordset from the Database
that would have 1 or many email addresses that you could concatenate
together and stick in the objEmail.To field.

--
-Dick Christoph
"B" <no_spam@.no_spam.com> wrote in message
news:c4mdnfssT45ImT7ZnZ2dnUVZ_r-dnZ2d@.rcn.net...
> Follow-up to my original post below.
> Is it possible for the "objEmail.To" to lookup the values from a sqlserver
> table?
> At the moment, I type the email address separated by a semi-colon.
> TIA~
>
> "B" <no_spam@.no_spam.com> wrote in message
> news:KsydnTnYtfFV2wbZnZ2dnUVZ_uqdnZ2d@.rcn.net...
>> My code below works fine when run from my pc (changed all the values for
>> obvious reasons). The code is placed inside a DTS task via VBS
>> scripting.
>> But when I try to run directly from the server where sqlserver is
> installed,
>> the script fails.
>>
>> I have SMTP running, but there is no outlook installed.
>>
>> Can someone please advise what I am missing.
>> Thanks
>> Bob
>>
>>
>> Set objEmail = CreateObject("CDO.Message")
>>
>> objEmail.From = "send@.test.com"
>> objEmail.To = "receive@.test.com"
>> objEmail.Subject = "TEST SUBJECT"
>> objEmail.AddAttachment "\\server\test.csv"
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/sendusing") = 2
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/smtpserver") = "SERVER_NAME"
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/smtpauthenticate") = 1
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/sendusername") = "username"
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/sendpassword") = "userpwd"
>>
> objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configu
>> ration/smtpserverport") = 25
>> objEmail.Configuration.Fields.Update
>> objEmail.Send
>>
>> set objEmail = nothing
>>
>>