Results 1 to 2 of 2

Thread: EXECUTE Stored Procedures from VBA

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    1

    Arrow

    Help!!!

    Can anyone tell me if it is possible to execute MS SQL stored procedures using VBScript written in Outlook forms?

    I am attempting to use the string below to execute the stored procedure but this results in an "DAO.connection ODBC--Call Failed" error.

    Set Rs = conDB.OpenRecordset("EXECUTE storedprocname", dbOpenSnapshot)

    If I use the same string to execute a query in a replica MS Access database then it works fine. Its only when I connect to the SQL database. I know for sure that the connection isn't the problem because the string below works fine:

    Set Rs = conDB.OpenRecordset("SELECT something FROM thedatabase", dbOpenSnapshot)

    Its only a problem when trying to excute a MS SQL stored procedure by refering to its name.

    If anyone can shed any light on this it would be hugely appreciated.

    Thank you !!!!

    Mike.

  2. #2
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290
    I would check the references in the project. Microsoft has new versions of the DLL that I had to download to get my SQL connection to work.

    The project needs to reference "msado15.dll". My version was 1.5 but I needed 2.1 for it to work.

Posting Permissions

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



Click Here to Expand Forum to Full Width