Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DTS Package w/ Dynamic MDB File

Posted on 2004-04-13
8
Medium Priority
?
511 Views
Last Modified: 2012-06-21
I've got a DTS package that's supposed to get a few global variables and export data to an Access MDB file defined by one of the variables.  The problem I'm having is that I can't get it to export to the right MDB file.  It's constantly going for the one defined in the Access Connection instead of the one defined in the Global Variable.  How do I make the DTS Package work with the MDB File path passed through the variable???
0
Comment
Question by:1cell
  • 4
  • 4
8 Comments
 
LVL 34

Expert Comment

by:arbert
ID: 10816697
How are you trying to use the global variables?  Dynamic Properties task? ActiveX script?
0
 
LVL 6

Author Comment

by:1cell
ID: 10816748
OK, Sorry.  Here's a little more info

First I've got a dynamic properties task that gets the global variables from a stored procedure.
Variables:
OfficeID
MDBFile
ExportID

Then there's an SQL Connection with a Transform Data Task to the Access connection
select top 30000 homephone
from tbl_template where regionID = ? and exportID is null

That's where I need to use the MDB File located in the path defined by the MDBFile variable value.

I do this in another package that works fine.  Can't figure out why it's not working here.  The only real difference is that the MDB File in this situation is the destination whereas the other situation uses it as a source.
0
 
LVL 6

Author Comment

by:1cell
ID: 10816757
sorry again, the parameter in that query is the OfficeID global variable.
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 34

Accepted Solution

by:
arbert earned 500 total points
ID: 10816918
I've had problems before where DTS doesn't actually change the parm and it uses the value that's already in the connection.  You can code this in your main script (or add and ActiveX script task and make it execute first with workflow):

Dim oConn, sFilename


      Set oConn = DTSGlobalVariables.Parent.Connections("NameOfYourAccessConnectionHere")
      oConn.DataSource = DTSGlobalVariables("MDBFile")
      Set oConn = Nothing

      Main = DTSTaskExecResult_Success
0
 
LVL 6

Author Comment

by:1cell
ID: 10817028
I guess I don't know where to find the connection name.  It's not just "Microsoft Access" as listed on the little icon.  Or if it is, I'm getting a runtime error anyway.
0
 
LVL 34

Expert Comment

by:arbert
ID: 10817052
If you double click on the connection, it's the text in the "existing connection" box...
0
 
LVL 6

Author Comment

by:1cell
ID: 10817364
Haha!  I love learning like this!  Thanks for the help!
0
 
LVL 34

Expert Comment

by:arbert
ID: 10817600
" I love learning like this!"

Ah ya, everyday is one big learning experience :)
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question