473,387 Members | 1,535 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,387 software developers and data experts.

DTS Package Help

Hi,

I have a DTS Package created in SQL Server but the client wants to
execute the DTS package from within MS Access by clicking a button.
If any one can tell me how to execute that DTS from with in MS
Access(VBA Code)

any suggestions would be helpful.
Thanks,
Shal

Dec 8 '06 #1
8 2489
DFS
Shals wrote:
Hi,

I have a DTS Package created in SQL Server but the client wants to
execute the DTS package from within MS Access by clicking a button.
If any one can tell me how to execute that DTS from with in MS
Access(VBA Code)

any suggestions would be helpful.
Thanks,
Shal
Shal,

I did it a while back. It was very easy, too. I don't have any DTS
packages to test, but as I recall you need to install DTS client software on
the PC, and in your Access file set a reference to the DTS Runtime (this is
done in the VBA module editor screen). Here's the code I used:
=============================================
Dim yieldMgmtDTS As New DTS.Package

'pseudo-code
DTSObject.Method database, userID, password, , , , , DTS package name

'example
yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser", "password", ,
, , , "Calc New Domestic CityPairs"

yieldMgmtDTS.Execute
Set yieldMgmtDTS = Nothing
MsgBox "Finished"
=============================================
You'll need to add error trapping, and figure out a way to validate that
your DTS package executed properly

Also ask on the comp.databases.ms-sqlserver group if this doesn't get you
going.

Dec 8 '06 #2
Shals wrote:
Hi,

I have a DTS Package created in SQL Server but the client wants to
execute the DTS package from within MS Access by clicking a button.
If any one can tell me how to execute that DTS from with in MS
Access(VBA Code)

any suggestions would be helpful.
Thanks,
Shal
There is likely a command for running the package directly but what we do is
create an Agent job to execute the DTS package and then use a passthrough
query to send the command to the server to run the Agent job. That provides
for an asynchronous operation where Access does not need to wait for the
task to complete.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Dec 8 '06 #3
You can do this directly from the SP as well using DTSRun.

If you use DTSRunUI and fill in the details correctly, then click on the
Advanced button and then the Generate button on the new screen it will give
you the command line to run the package using DTSRun, which you can then
just copy and paste.

--

Terry Kreft
"Rick Brandt" <ri*********@hotmail.comwrote in message
news:2Q******************@newssvr27.news.prodigy.n et...
Shals wrote:
Hi,

I have a DTS Package created in SQL Server but the client wants to
execute the DTS package from within MS Access by clicking a button.
If any one can tell me how to execute that DTS from with in MS
Access(VBA Code)

any suggestions would be helpful.
Thanks,
Shal

There is likely a command for running the package directly but what we do
is
create an Agent job to execute the DTS package and then use a passthrough
query to send the command to the server to run the Agent job. That
provides
for an asynchronous operation where Access does not need to wait for the
task to complete.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


Dec 8 '06 #4
I tried using this code in my Access application but I got stuck at

yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser",
"password", ,
, , , "Calc New Domestic CityPairs"

LoadFromSQLServer command as it requires Username and Password. I don't
know what username and password to enter.

can't we override these parameters.
DFS wrote:
Shals wrote:
Hi,

I have a DTS Package created in SQL Server but the client wants to
execute the DTS package from within MS Access by clicking a button.
If any one can tell me how to execute that DTS from with in MS
Access(VBA Code)

any suggestions would be helpful.
Thanks,
Shal

Shal,

I did it a while back. It was very easy, too. I don't have any DTS
packages to test, but as I recall you need to install DTS client software on
the PC, and in your Access file set a reference to the DTS Runtime (this is
done in the VBA module editor screen). Here's the code I used:
=============================================
Dim yieldMgmtDTS As New DTS.Package

'pseudo-code
DTSObject.Method database, userID, password, , , , , DTS package name

'example
yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser", "password", ,
, , , "Calc New Domestic CityPairs"

yieldMgmtDTS.Execute
Set yieldMgmtDTS = Nothing
MsgBox "Finished"
=============================================
You'll need to add error trapping, and figure out a way to validate that
your DTS package executed properly

Also ask on the comp.databases.ms-sqlserver group if this doesn't get you
going.
Dec 14 '06 #5
Hi.
requires Username and Password. I don't
know what username and password to enter.

can't we override these parameters.
Sorry. If you don't have the user name and password, we have to assume it's
because you aren't authorized to have them. We can't help you hack into someone
else's SQL Server database.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"Shals" <s_******@berkeley.eduwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
>I tried using this code in my Access application but I got stuck at

yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser",
"password", ,
, , , "Calc New Domestic CityPairs"

LoadFromSQLServer command as it requires Username and Password. I don't
know what username and password to enter.

can't we override these parameters.
DFS wrote:
>Shals wrote:
Hi,

I have a DTS Package created in SQL Server but the client wants to
execute the DTS package from within MS Access by clicking a button.
If any one can tell me how to execute that DTS from with in MS
Access(VBA Code)

any suggestions would be helpful.
Thanks,
Shal

Shal,

I did it a while back. It was very easy, too. I don't have any DTS
packages to test, but as I recall you need to install DTS client software on
the PC, and in your Access file set a reference to the DTS Runtime (this is
done in the VBA module editor screen). Here's the code I used:
=============================================
Dim yieldMgmtDTS As New DTS.Package

'pseudo-code
DTSObject.Method database, userID, password, , , , , DTS package name

'example
yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser", "password", ,
, , , "Calc New Domestic CityPairs"

yieldMgmtDTS.Execute
Set yieldMgmtDTS = Nothing
MsgBox "Finished"
=============================================
You'll need to add error trapping, and figure out a way to validate that
your DTS package executed properly

Also ask on the comp.databases.ms-sqlserver group if this doesn't get you
going.

Dec 14 '06 #6
It's not like that, but it's the company policy that networking people
maintain the servers so they have given us access thru windows login to
the servers but we need SQL Server password right?

Besides I have created the DTS on SQL Server only and my Access
Application is connecting to SQL Server thru connectionstring which
uses ODBC connection.

Can I use ODBC DataSource name in parameters for LoadFromSQLServer
Command?

'69 Camaro wrote:
Hi.
requires Username and Password. I don't
know what username and password to enter.

can't we override these parameters.

Sorry. If you don't have the user name and password, we have to assume it's
because you aren't authorized to have them. We can't help you hack into someone
else's SQL Server database.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"Shals" <s_******@berkeley.eduwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
I tried using this code in my Access application but I got stuck at

yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser",
"password", ,
, , , "Calc New Domestic CityPairs"

LoadFromSQLServer command as it requires Username and Password. I don't
know what username and password to enter.

can't we override these parameters.
DFS wrote:
Shals wrote:
Hi,

I have a DTS Package created in SQL Server but the client wants to
execute the DTS package from within MS Access by clicking a button.
If any one can tell me how to execute that DTS from with in MS
Access(VBA Code)

any suggestions would be helpful.
Thanks,
Shal

Shal,

I did it a while back. It was very easy, too. I don't have any DTS
packages to test, but as I recall you need to install DTS client software on
the PC, and in your Access file set a reference to the DTS Runtime (this is
done in the VBA module editor screen). Here's the code I used:
=============================================
Dim yieldMgmtDTS As New DTS.Package

'pseudo-code
DTSObject.Method database, userID, password, , , , , DTS package name

'example
yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser", "password", ,
, , , "Calc New Domestic CityPairs"

yieldMgmtDTS.Execute
Set yieldMgmtDTS = Nothing
MsgBox "Finished"
=============================================
You'll need to add error trapping, and figure out a way to validate that
your DTS package executed properly

Also ask on the comp.databases.ms-sqlserver group if this doesn't get you
going.
Dec 14 '06 #7
Hi.
it's the company policy that networking people
maintain the servers so they have given us access thru windows login to
the servers but we need SQL Server password right?
Probably not. There are two ways to authenticate, either through Windows NT
authentication (the secure way) or through SQL Server authentication. The SQL
Server DBA most likely set it up for you to only authenticate with Windows NT
authentication. For Windows NT authentication, use empty strings for user name
and password parameters in LoadFromSQLServer( ). Otherwise, you should use your
SQL Server login credentials. If your DTS package has a password, you must use
that as one of the parameters.

Syntax:

Sub LoadFromSQLServer(ServerName As String, [SQLServerUserName As String],
[SQLServerPassword As String], [Flags As DTSSQLServerStorageFlags =
DTSSQLStgFlag_Default], [PackagePassword As String], [PackageGuid As String],
[PackageVersionGuid As String], [PackageName As String], [pVarPersistStgOfHost])

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"Shals" <s_******@berkeley.eduwrote in message
news:11**********************@73g2000cwn.googlegro ups.com...
It's not like that, but it's the company policy that networking people
maintain the servers so they have given us access thru windows login to
the servers but we need SQL Server password right?

Besides I have created the DTS on SQL Server only and my Access
Application is connecting to SQL Server thru connectionstring which
uses ODBC connection.

Can I use ODBC DataSource name in parameters for LoadFromSQLServer
Command?

'69 Camaro wrote:
>Hi.
requires Username and Password. I don't
know what username and password to enter.

can't we override these parameters.

Sorry. If you don't have the user name and password, we have to assume it's
because you aren't authorized to have them. We can't help you hack into
someone
else's SQL Server database.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"Shals" <s_******@berkeley.eduwrote in message
news:11**********************@j72g2000cwa.googleg roups.com...
>I tried using this code in my Access application but I got stuck at

yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser",
"password", ,
, , , "Calc New Domestic CityPairs"

LoadFromSQLServer command as it requires Username and Password. I don't
know what username and password to enter.

can't we override these parameters.
DFS wrote:
Shals wrote:
Hi,

I have a DTS Package created in SQL Server but the client wants to
execute the DTS package from within MS Access by clicking a button.
If any one can tell me how to execute that DTS from with in MS
Access(VBA Code)

any suggestions would be helpful.
Thanks,
Shal

Shal,

I did it a while back. It was very easy, too. I don't have any DTS
packages to test, but as I recall you need to install DTS client software
on
the PC, and in your Access file set a reference to the DTS Runtime (this
is
done in the VBA module editor screen). Here's the code I used:
=============================================
Dim yieldMgmtDTS As New DTS.Package

'pseudo-code
DTSObject.Method database, userID, password, , , , , DTS package name

'example
yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser", "password",
,
, , , "Calc New Domestic CityPairs"

yieldMgmtDTS.Execute
Set yieldMgmtDTS = Nothing
MsgBox "Finished"
=============================================
You'll need to add error trapping, and figure out a way to validate that
your DTS package executed properly

Also ask on the comp.databases.ms-sqlserver group if this doesn't get you
going.

Dec 14 '06 #8
Thanks for suggestions,

i got it working by just giving the DTSSQLServerStorageFlags value =
256 for windows authentication from trusted connection.

the value is 0 for the flag if you have server username and password
value with you.

So now the DTS is working
Thanks a lot.
'69 Camaro wrote:
Hi.
it's the company policy that networking people
maintain the servers so they have given us access thru windows login to
the servers but we need SQL Server password right?

Probably not. There are two ways to authenticate, either through Windows NT
authentication (the secure way) or through SQL Server authentication. The SQL
Server DBA most likely set it up for you to only authenticate with Windows NT
authentication. For Windows NT authentication, use empty strings for user name
and password parameters in LoadFromSQLServer( ). Otherwise, you should use your
SQL Server login credentials. If your DTS package has a password, you must use
that as one of the parameters.

Syntax:

Sub LoadFromSQLServer(ServerName As String, [SQLServerUserName As String],
[SQLServerPassword As String], [Flags As DTSSQLServerStorageFlags =
DTSSQLStgFlag_Default], [PackagePassword As String], [PackageGuid As String],
[PackageVersionGuid As String], [PackageName As String], [pVarPersistStgOfHost])

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"Shals" <s_******@berkeley.eduwrote in message
news:11**********************@73g2000cwn.googlegro ups.com...
It's not like that, but it's the company policy that networking people
maintain the servers so they have given us access thru windows login to
the servers but we need SQL Server password right?

Besides I have created the DTS on SQL Server only and my Access
Application is connecting to SQL Server thru connectionstring which
uses ODBC connection.

Can I use ODBC DataSource name in parameters for LoadFromSQLServer
Command?

'69 Camaro wrote:
Hi.

requires Username and Password. I don't
know what username and password to enter.

can't we override these parameters.

Sorry. If you don't have the user name and password, we have to assume it's
because you aren't authorized to have them. We can't help you hack into
someone
else's SQL Server database.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact info.
"Shals" <s_******@berkeley.eduwrote in message
news:11**********************@j72g2000cwa.googlegr oups.com...
I tried using this code in my Access application but I got stuck at

yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser",
"password", ,
, , , "Calc New Domestic CityPairs"

LoadFromSQLServer command as it requires Username and Password. I don't
know what username and password to enter.

can't we override these parameters.
DFS wrote:
Shals wrote:
Hi,

I have a DTS Package created in SQL Server but the client wants to
execute the DTS package from within MS Access by clicking a button.
If any one can tell me how to execute that DTS from with in MS
Access(VBA Code)

any suggestions would be helpful.
Thanks,
Shal

Shal,

I did it a while back. It was very easy, too. I don't have any DTS
packages to test, but as I recall you need to install DTS client software
on
the PC, and in your Access file set a reference to the DTS Runtime (this
is
done in the VBA module editor screen). Here's the code I used:
=============================================
Dim yieldMgmtDTS As New DTS.Package

'pseudo-code
DTSObject.Method database, userID, password, , , , , DTS package name

'example
yieldMgmtDTS.LoadFromSQLServer "yieldMgmtDB", "yieldMgmtUser", "password",
,
, , , "Calc New Domestic CityPairs"

yieldMgmtDTS.Execute
Set yieldMgmtDTS = Nothing
MsgBox "Finished"
=============================================
You'll need to add error trapping, and figure out a way to validate that
your DTS package executed properly

Also ask on the comp.databases.ms-sqlserver group if this doesn't get you
going.
Dec 14 '06 #9

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

Similar topics

3
by: Javier Sanchez | last post by:
Hi all, I am experiencing a problem whereby a PL/SQL package is valid for some time (and runs succesfully a few times) and then suddenly becomes invalid in DB. If I recompile this package it works...
1
by: Cox News Server | last post by:
I'm a rookie with MSSQL. I need to run a DTS package to export a result set to an MX Excel spread sheet. I need to call the DTS from a stored procedure and pass it three values, depending on the...
2
by: Jim Andersen | last post by:
Hejsa, Jeg har lavet en DTS-package og den virker når jeg kører den pr. håndkraft, men når den køres af SQL Server Agenten, fejler den. Det skal også lige siges at jeg har brugt guiden til at...
5
by: Jim Andersen | last post by:
Hi, I made a DTS-package and it works when I execute it manually, but when it is run by the SQL Server Agent, it fails. I have use the guide to create a maintenance plan. That doesn't work so...
4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
1
by: KR | last post by:
The DTS package runs fine through Enterprise manager successfully. However, when scheduled through a job that runs the dts through the following code: DECLARE @findfile int Exec @findfile =...
0
by: shark | last post by:
Hi All, i am getting the error as posted below while executing Transfer logins using Dts package - sql server 2000 standard edition Can any body help? Microsoft Windows (C) Copyright...
0
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to...
0
by: Jack Lee | last post by:
I try to set a job to run a DTS package, failed. My environment is SQL Server 2000 sp4 on windows Server 2003. There is a local window group called Dev_accnt including member SQLTesting who is...
0
by: Steven Samuel Cole | last post by:
Hi Stephane, thanks for your reply! :-) I do not get any notification or warning or whatever from dpkg, all output I get when running # sudo dpkg -i python-<package name>_0.0.1-4927-1_all.deb...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.