Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DTS Package w/ Dynamic MDB File

Posted on 2004-04-13
8
Medium Priority
?
507 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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 …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

670 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