Results 1 to 2 of 2

Thread: calling a stored procedure

  1. #1
    Fanatic Member davebat's Avatar
    Join Date
    Dec 02
    Posts
    727

    calling a stored procedure

    does anyone know how i can call a stored procedure from an activex script task within a dts package

  2. #2
    New Member
    Join Date
    Nov 05
    Posts
    9

    Re: calling a stored procedure

    Dave,

    I am assuming you are calling a SP that is in your SQLServer. I have not done this exactly but I do frequently call stored querys that are in access using the method that you described. Since querys, views, SP's are all objects I'm assuming that it would be very similar.

    VB Code:
    1. 'This is the code I would use in the activeX of my DTS
    2. Set TheDB = CreateObject("ADODB.Connection")
    3. TheDB.Mode = adModeReadWrite
    4. TheDB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="c:\somefolder\DB\MyDatabase.mdb")
    5.  
    6.     TheDB.Execute ("exec QueryName " & ParameterName & "") ' If there are Parameters
    7.     TheDB.Execute ("exec QueryName") ' If there are no parameters
    8.  
    9. TheDB.Close
    10. Set TheDB = Nothing

    Regards,
    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •