sending a parameter from an access database to a DTS package in sqlserver

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ewehbe
    New Member
    • Jul 2006
    • 4

    sending a parameter from an access database to a DTS package in sqlserver

    I am trying to call this command from an access data base through RUNAPP macro commande:

    "C:\program files\microsoft sql server\80\Tools \Binn\dtsrun.ex e" /S "(local)" /N "mypackage" /E /A mydate:8 = "Forms!Opensitu ation!Combo4"

    mypackage: is the name of the dts package in sqlserver
    mydate is the name of the global variable used in sql server
    8 is the string type
    Forms!Opensitua tion!Combo4: is the combo box variable in the access form Opensituation where a string is captured

    Instead of getting what is in the combo box Combo4, (that is a string). in the sql server global variable mydate,
    i am getting the following string "Forms!Opensitu ation!Combo4"

    SO how could i pass a variable parameter from access to dts package in sqlserver?
  • ewehbe
    New Member
    • Jul 2006
    • 4

    #2
    Originally posted by ewehbe

    I am trying to call this command from an access data base through RUNAPP macro commande:

    "C:\program files\microsoft sql server\80\Tools \Binn\dtsrun.ex e" /S "(local)" /N "mypackage" /E /A mydate:8 = "Forms!Opensitu ation!Combo4"

    mypackage: is the name of the dts package in sqlserver
    mydate is the name of the global variable used in sql server
    8 is the string type
    Forms!Opensitua tion!Combo4: is the combo box variable in the access form Opensituation where a string is captured

    Instead of getting what is in the combo box Combo4, (that is a string). in the sql server global variable mydate,
    i am getting the following string "Forms!Opensitu ation!Combo4"

    SO how could i pass a variable parameter from access to dts package in sqlserver?

    since no one did answer me yet, I conrinue my research and found the following answer:
    instead of using the macro command runapp I used the event procedure function
    shell then I concatenate all the comand string in a variable that i called by the shell function and it works verry well. The codes became as follows:

    dim getvar, var1
    var1 = "C:\program files\microsoft sql server\80\Tools \Binn\dtsrun.ex e /S (local) /N mypackage /E /A mydate:8 ="
    var1 = var1 & Forms!Opensitua tion!Combo4.val ue
    getvar = shell (var1)


    note the following:
    i keep the (") only in the beginning and the end of the first command string
    i use (&) instead of (+) to concatenate the comande string
    I add the (.Value) to my combo variable.

    it realy works and let me reduce the execution of inserting 32000 records i a table from 2mn while using an acces insert query to 2second by doing the same thing through dts in sql server environment

    bye

    Comment

    Working...