Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2004
    Posts
    285
    Provided Answers: 1

    Unanswered: Connecting to SAP from aspx web page

    Good day,

    I have some code which works perfectly well in a macro of a spreadsheet but now need to put it into a aspx page. Unfortunately it is failing right at the very beginning. My code portion is as follows:

    PUBLIC Sub SAP
    Dim LogonControl
    Dim funcControl
    Dim TableFactoryCtrl
    Try
    LogonControl = Server.CreateObject("SAP.LogonControl.1")
    funcControl = Server.CreateObject("SAP.Functions")
    TableFactoryCtrl = Server.CreateObject("SAP.TableFactory.1")
    Catch ex As Exception
    lbInformation.Text = Err.Description
    End Try
    End SUb

    It is failing on the line LogonControl = Server.CreateObject("SAP.LogonControl.1") with the following error:
    Retrieving the COM class factory for component with CLSID {B24944D6-1501-11CF-8981-0000E8A49FA0} failed due to the following error: 80040154

    SAP is installed on the Server from where the page is running and the macro in the spreadsheet when run on the server where the page is been run from works fine. I just can't understand why this is not working.

    The page is a VB asp dot net page.

    Please help.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What does that error number mean?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2004
    Posts
    285
    Provided Answers: 1
    From what I can make out it appears to have to do with Class not registered. But I don't understand how that can be when it works perfectly in my VB Script in Excel just not in my aspx web page.

  4. #4
    Join Date
    Nov 2004
    Posts
    285
    Provided Answers: 1
    VERY old reply but after all these years of using a work around I have found the solution. Ensure that the "Enable 32 bit applications" option of the Application Pool being used is set to TRUE. So simple in the end, but caused so much havoc over the years. Just in case anyone ever needs an answer now you have one. Have tested on multiple servers, set it to FALSE, false, set it to TRUE, instantly works. That is what I have found anyway with the SAP.LogonControl.1 anyway.

  5. #5
    Join Date
    Nov 2004
    Posts
    285
    Provided Answers: 1
    In IIS you may need to run the following, newer IIS has Advanced options where you can set it.

    cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true

Posting Permissions

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