+ Reply to Thread
Results 1 to 4 of 4

execute stored procedure from excel

  1. #1
    maxzsim
    Guest

    execute stored procedure from excel

    Hi,

    I have created procedure ProcA that creates a table TblA in SQL

    how do i call the stored procedure from Excel to execute that stored
    procedure ?

    appreciate any advise

    tks & rdgs

  2. #2
    Gary Brown
    Guest

    Did you know...

    You've posted 63 questions to this forum and never indicated that anyone had
    ever answered your question satisfactorily?

    That said...
    I THINK you might want to try...

    DATA / GET EXTERNAL DATA / RUN SAVED QUERY

    HTH,
    --
    Gary Brown
    [email protected]


    "maxzsim" wrote:

    > Hi,
    >
    > I have created procedure ProcA that creates a table TblA in SQL
    >
    > how do i call the stored procedure from Excel to execute that stored
    > procedure ?
    >
    > appreciate any advise
    >
    > tks & rdgs


  3. #3
    maxzsim
    Guest

    RE: Did you know...

    Hi Gary,

    My appologies for posting the same question in Excel - Programming as i
    tot i have posted but yet i could not find my posting

    as for my indication of whether the reply has been successful , i did not
    realise that i actually need to do that

    as for my ques , is there any way to do it programmatically ?
    this is how i write my code :

    ====================================
    Dim strConn As String
    Dim con As Connection
    Dim comm As ADODB.Command
    strConn = "Provider=SQLOLEDB;Data Source=SvrA;InititalCatalog
    =master;uid=;pwd="

    Set con.Execute = strConn
    Set comm = New Command
    comm.ActiveConnection = con
    comm.CommandText = "SQL1.master.dbo.Usr_GetUserAccess"
    comm.CommandType = adCmdStoredProc
    'comm.ActiveConnection = strConn
    comm.Execute strConn

    Set rs = New ADODB.Recordset
    rs.Open "Select * from [UserAccess]", con

    =====================================

    but i have some problem using the connection objects

    appreciate your advise
    rdgs,

    "Gary Brown" wrote:

    > You've posted 63 questions to this forum and never indicated that anyone had
    > ever answered your question satisfactorily?
    >
    > That said...
    > I THINK you might want to try...
    >
    > DATA / GET EXTERNAL DATA / RUN SAVED QUERY
    >
    > HTH,
    > --
    > Gary Brown
    > [email protected]
    >
    >
    > "maxzsim" wrote:
    >
    > > Hi,
    > >
    > > I have created procedure ProcA that creates a table TblA in SQL
    > >
    > > how do i call the stored procedure from Excel to execute that stored
    > > procedure ?
    > >
    > > appreciate any advise
    > >
    > > tks & rdgs


  4. #4
    Gary Brown
    Guest

    RE: Did you know...

    Try turning on the Macro Recorder...
    TOOLS / MACRO / RECORD NEW MACRO
    Then run your query using...
    DATA / GET EXTERNAL DATA / RUN SAVED QUERY
    Then review the code that was created. It may put you on the right track.
    HTH,
    --
    Gary Brown
    [email protected]


    "maxzsim" wrote:

    > Hi Gary,
    >
    > My appologies for posting the same question in Excel - Programming as i
    > tot i have posted but yet i could not find my posting
    >
    > as for my indication of whether the reply has been successful , i did not
    > realise that i actually need to do that
    >
    > as for my ques , is there any way to do it programmatically ?
    > this is how i write my code :
    >
    > ====================================
    > Dim strConn As String
    > Dim con As Connection
    > Dim comm As ADODB.Command
    > strConn = "Provider=SQLOLEDB;Data Source=SvrA;InititalCatalog
    > =master;uid=;pwd="
    >
    > Set con.Execute = strConn
    > Set comm = New Command
    > comm.ActiveConnection = con
    > comm.CommandText = "SQL1.master.dbo.Usr_GetUserAccess"
    > comm.CommandType = adCmdStoredProc
    > 'comm.ActiveConnection = strConn
    > comm.Execute strConn
    >
    > Set rs = New ADODB.Recordset
    > rs.Open "Select * from [UserAccess]", con
    >
    > =====================================
    >
    > but i have some problem using the connection objects
    >
    > appreciate your advise
    > rdgs,
    >
    > "Gary Brown" wrote:
    >
    > > You've posted 63 questions to this forum and never indicated that anyone had
    > > ever answered your question satisfactorily?
    > >
    > > That said...
    > > I THINK you might want to try...
    > >
    > > DATA / GET EXTERNAL DATA / RUN SAVED QUERY
    > >
    > > HTH,
    > > --
    > > Gary Brown
    > > [email protected]
    > >
    > >
    > > "maxzsim" wrote:
    > >
    > > > Hi,
    > > >
    > > > I have created procedure ProcA that creates a table TblA in SQL
    > > >
    > > > how do i call the stored procedure from Excel to execute that stored
    > > > procedure ?
    > > >
    > > > appreciate any advise
    > > >
    > > > tks & rdgs


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1