on 10-01-2008 5:02 PM
I recently started to attempt an integration from a business app into SAP Business One using the SDK. I can create the com objects and set the connection values, but when I attempt to connect I receive "Failed To Connect To SBOCommon" which is error 111. When I run the basic operations sample from the SDK I receive the same issue.
The SQL Server database is there and the credentials that I pass should be good. I can connect to the database using an ODBC driver and so I don't believe that it is a permissions issue. Am I missing a licencing component?
Any help would be appreciated.
Regards,
Trevor
I think I have some more light to shed on the matter. I set up a line by line test of my connection code and set every property on the company object that made sense. When I ran it on the client's server it complained that the MSSQL2005 database type is not supported. When I set it to MSSQL it stopped complaining, but I get the failed to connect message. Anyone know if MSSQL2005 is supported?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trevor,
i have your same issue connecting to the sap company database.
i'm using DI API 2005 and MSSQL 2005.
below my code:
oCompany.Server = "MSIE7";
oCompany.CompanyDB = "SBODemo_IT";
oCompany.UserName = "manager";
oCompany.Password = "manager";
oCompany.language = SAPbobsCOM.BoSuppLangs.ln_Italian;
oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005;
oCompany.UseTrusted = true;
lRetCode = oCompany.Connect();
i get lRetCode = -111
have you solved this issue?
thanks in advance
Andrea
i have encountered the same issue and have solved it
companyValue.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005
this is the key sentence.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trever,
Please ensure that SQL Native Client is installed in your working system or not.if not please intall and check for connection.
regards,
varma.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks guys but I still seem to have an issue. The copy of SAP that I'm using is net new and so the the SDK and common database should be in synch as neither have need to be patched yet.
Are you sure that I need to be able to access the license server? According to the reading I have done in the DI API SDK help files and online the company has 5 manuditory fields in order to make a connection and the license sever is not one of them. Incase, do you know how I go about finding the linces server reference and port? I didn't do any of the installation on the server and it may be worth confirming that the license server is running. The services manager does not tell you much at all, but the service seems to be running at the very least.
I can connect to the database using an ODBC connection, but I would much rather go through the SDK so that my solution is supported and should have at least some change protection, which my customer would prefer.
I would post my connection code, but as I'm writing the actual integration in VFP it would likely not prove too helpful. At this point I am simply trying to get the C# sample to run and the basic operation sample is exeriencing the same issue. Also, I copied the connection code from the SDK help file into a new VB project and it failed as well. That is why I suspect that it might be a license or installation issue.
Anyone have any ideas on where I can go from here?
Thanks,
Trevor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trevor,
You definitely need to have the license server running in order to use the DI API. If you don't specify a license server in your code then it will default to port 30000 on the database server (which should be ok if you installed the server tools on the same server as SQL). If you are running any firewall software on the client (eg Microsoft Windows firewall) then try putting an exception in the firewall for port 30000. The SBO user you are using to connect via the DI API must be a licensed user and have a SDK license assigned to the account.
I am assuming that you can log in to SBO using the client software without any issues.
As you are using SQL 2005, have you installed the SQL Native Client on the workstation where you are running your code (this will automatically be installed on the database server but must be installed separately on each workstation)?
Kind Regards,
Owen
Hi
To have connection to database you can use this function below.
Also you can read connection parameters from an database table.
It can be trusted or using db user credentionals.
Regards
Sierdna S.
Private glob_oSqlConn
...
Private Function SetSBOConnection(ByRef oSBOCompany As SAPbobsCOM.Company) As Boolean
Dim b As Boolean = False
Try
Dim sDBServer As String = oSBOCompany.Server
Dim sDBCompany As String = oSBOCompany.CompanyDB
Dim sDBUser As String = oSBOCompany.DbUserName
Dim sDBPwd As String = '*******'
Dim sConnectionString As String = "Server=" & sDBServer & _
";Database=" & sDBCompany & _
";User ID=" & sDBUser & _
";Password=" & sDBPwd & _
";Trusted_Connection=False;"
glob_oSqlConn = New SqlConnection(sConnectionString)
glob_oSqlConn.Open()
b = True
Catch ex As Exception
' log exception
Finally
System.GC.Collect() 'Release the handle to the table
End Try
Return b
End Function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks David,
I tried both of those things and the issue is still there at this point. You had suggested that there were additional known causes. Could I prevail upon you to suggest some more?
Thanks again,
Ian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trevor,
Are you setting the property to connect to the license server? You need to supply the port number as well as the server name or IP address where the license server is running (eg MYSERVER:30000). If the DI API cannot find the license server then you'll get the error you've mentioned.
Perhaps you could post your connection code as it'll make it easier to spot where the issue is.
Kind Regards,
Owen
Hi Trevor,
Sometimes you will see this error if you don't set the database server type:
oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005
I would also suggest trying the variations of the server name (!P address, server domain name)
Failing that, it might be a DI API issue:
1. Locate the Temp folder by going to Start -> Run and type %temp%.
2. Locate the SM_OBS_DLL folder here and delete it.
3. Uninstall the DI API from Add/Remove Programs.
4. Reboot your PC
5. Install the DI API from your current patch. (Download patch, extract it and then browse to Packages\DI API and run setup.exe)
6. Run the Upgrader Common again (From the same patch as above - very important!). Browse to Packages\Upgrader Common and run setup.exe. This will update the SBO-COMMON to this patch level again. You will not lose any data.
This refreshes your DI and ensures you are using the same one as the SBO-COMMON when trying to connect.
Hope this is useful
Regards,
Niall
SAP Business One Forums
Hi,
this can have several reasons:
1.) you are trying to make a trusted connection
try once .UseTrusted= false
and set also
DbUserName = "sa"
DbPassword = "pwd"
2.) some diapi temp files are corrupt.
go to your temp directory and kill the
C:\Dokumente und Einstellungen\profilename\Lokale Einstellungen\Temp\SM_OBS_DLL
directory
this two points are good things to start with
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
7 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.