[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

DTS Package w/ Dynamic MDB File

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
1cell
Asked:
1cell
  • 4
  • 4
1 Solution
 
arbertCommented:
How are you trying to use the global variables?  Dynamic Properties task? ActiveX script?
0
 
1cellAuthor Commented:
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
 
1cellAuthor Commented:
sorry again, the parameter in that query is the OfficeID global variable.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
arbertCommented:
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
 
1cellAuthor Commented:
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
 
arbertCommented:
If you double click on the connection, it's the text in the "existing connection" box...
0
 
1cellAuthor Commented:
Haha!  I love learning like this!  Thanks for the help!
0
 
arbertCommented:
" I love learning like this!"

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now