on 2006 Jan 06 7:20 PM
Hi,
Can DI API be used to connect to SAP Business One database from an ASP.net application? Or is it required to use DI Server only?
Thanks,
Aparna
Hi Aparna:
the answer is DI-Server only. Thats the only way
Harold Gómez V.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The DI API can be used by a ASP.NET Web App or Web Server... I am not sure why Harold Says DI-Server only... Unless I am miss understanding the question... The DI-Server accesses the Data through the use of SOAP... But if you use the DI API you can access the data base through recordset objects or you can templete the recordset object by using buisness objects for easyer control of navigation and standard data functionality, ie, Updates, deletes, creates... If I am misstaken here please let me know... This is just how i have been doing things... thanks...
Hi Jeremy,
I tried using DI API in ASP.NET application but could not use it. So I was not sure if it can be used.
I get an error "Failed to Extract OBServer.dll from CAB File" on the oCompany.connect statement.
I could not find anything on this error in the forum. Do you know why I would be getting this message? I do not have much experience in ASP.NET
It will be much easier if I can use the DI API, I would appreciate any help.
Thanks,
Aparna
"Failed to Extract OBServer.dll from CAB File"
That is an interesting error... Not sure why your getting it but from the error message makes me wonder if you have things installed correctly and completely... As to connecting to a company... here is the code I use and it works for me...
<i>Try
vCmp = New SAPbobsCOM.Company
vCmp.Server = "XXXXX" 'Name of the DB Server
vCmp.CompanyDB = "XXXXX" 'Enter name of your company
vCmp.UserName = "XXXXX" 'Enter the B1 user name
vCmp.Password = "XXXXX" 'Enter the B1 password
vCmp.DbUserName = "XXXXX"
vCmp.DbPassword = "XXXXX"
vCmp.language = SAPbobsCOM.BoSuppLangs.ln_English 'Enter the logon language
vCmp.UseTrusted = False
' Activate connection
lRetCode = vCmp.Connect
' Make sure connection is successful
If lRetCode <> 0 Then
vCmp.GetLastError(lErrCode, sErrMsg)
Return sErrMsg
End If
Catch Ex As Exception
Return Ex.Message
End Try</i>
Hope this helps...
Hi Jeremy,
This is the exact code I am using. And interestingly, it works perfectly in my VB.NET application on the same machine. I am using a windows 2000 server.
I also tried on a different machine and received the same error.
I will try to uninstall and re-install but not sure if that will help.
Thanks,
Aparna
Jeremy:
tried your code, without success.
I've been trying to find the formal definition of why you have to use di server in an asp.net application but cannot remember the exact document.
What I remember is my SDK instructor telling us something about marshaling the observer.dll, and the use of the coonection pooling mechanism.
But I know for sure that, if you want to publish an application on internet, with access to SBO, you'll have to break several rules of security if you can use the di-api.
the rule of gold is, web project, use di-server to build web services. Then use asp.net or any other development language to consume those web services.
Harold Gómez.
Just wonder what version you are using... This code works with the 2005a SBO version we are using here... As for the DI Service... I have a question about that... We are wanting to use it but haven't been able to find any documentation that states that it works with UDO... I am assuming that it does... And the part about security, is interesting to know... Thanks for the information... Would like to go through a SDK training... Oh, well...
User | Count |
---|---|
112 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
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.