Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    65

    Unanswered: Calling Stored proc in ActiveX script

    Hi!

    How do you call a store procedure in an ActiveX script? I have a stored procedure that I want to execute everytime my Data Driven Query tasks inserts a new record.

    Thanks.

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245
    Code:
    Dim oConn
    Dim oComm
    
    Set oConn = CreateObject("ADODB.Connection")
    Set oComm = CreateObject("ADODB.Command")
    
    oConn.ConnectionString = sConnectionString
    oConn.Open
    
    oComm.CommandText = "myStoredProc"
    oComm.CommandType = 4 ' adStoredProc
    oComm.Parameters.Refresh
    oComm.Parameters("myParam") = "This"
    oComm.ActiveConnection = oConn
    
    oComm.Execute
    (alternatively)
    Code:
    Set oRS = oComm.Execute
    Written from the top of my head. Your mileage may very. Check syntax carefully. Never run while carrying scissors by the handle. Always keep your barrel pointed downrange.

    Regards,

    hmscott
    Have you hugged your backup today?

  3. #3
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    65
    thanks for the advice!

Posting Permissions

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