Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8533

Re: Macro Excel 2010 using DI API doesn't connect on SBOCOMMON

$
0
0

Hi:

 

I think that you need to reference to License Server including the port.

 

This code works well for me:

 

    oCompany.Server = txtServer

    oCompany.LicenseServer = txtServer & ":" & txtPort

    oCompany.UseTrusted = False

    oCompany.DbServerType = dst_MSSQL2012

    oCompany.DbUserName = "sa" 'You can replace this with a proper SQL user

    oCompany.DbPassword = B1DBPassword 'Replace with a variable or password text

    oCompany.CompanyDB = lbCompanies.Value 'Reference a list box object, replace with DB name

    oCompany.UserName = txtUser

    oCompany.Password = txtPass

 

 

    lRetCode = oCompany.Connect()

   

    If lRetCode <> 0 Then

        ErrCod = oCompany.GetLastErrorCode

        ErrMsg = oCompany.GetLastErrorDescription

        MsgBox (CStr(ErrCod) & ": " & ErrMsg)

        Application.StatusBar = (CStr(ErrCod) & ": " & ErrMsg)

    Else

       ExcelStatBar = "Conectado a: " & oCompany.CompanyName & "; Usuario: " & txtUser

       Application.StatusBar = ExcelStatBar

    End If


Viewing all articles
Browse latest Browse all 8533

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>