Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    17

    Question Unanswered: Calling a Stored Procedure from Access 2002

    I'm trying to use a command button in Access 2002 to execute a stored procedure on the SQL 2000 server. I don't need to pass any variables or anything just execute the stored procedure. Anyone know how to do this? Thanks a lot for your help!!

  2. #2
    Join Date
    Jan 2004
    Posts
    17
    Got it - I used a pass through query.

  3. #3
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346

    Re: Calling a Stored Procedure from Access 2002

    Another alternative if you are using ADO is to call the Execute method from the Connection object. Here is an example:

    Dim cn as ADODB.connection

    Set cn = new ADODB.connection

    cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DataBaseName;Data Source=ServerName"

    cn.Open

    cn.Execute "sp_Test"

    cn.Close

    Set cn = Nothing
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  4. #4
    Join Date
    Jan 2004
    Posts
    17
    I like that solution, SCIROCCO. Thanks for posting it!

Posting Permissions

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