Skip to Content
Former Member
Apr 09, 2008 at 12:26 PM

GetCompanyList from 05.OrderAndInvoice Sample


Good Day


Earlier in the week, Leonardo helped me out with the line to set the dbType for SQL2005 in the code below. For the past couple of daya I have been testing with (local) for the Server. I then would get a list of db's on my local machine. However, this morning I am trying to get a list of db's from our Server but am receiving an error when executing line --> oRecordSet = oCompany.GetCompanyList.

The Server...does that just have to be the IP Address? What is the SAP code expecting here for the Server?



If e.KeyCode = Keys.Enter Or e.KeyCode = Keys.Tab Then

e.SuppressKeyPress = True

oCompany = New SAPbobsCOM.Company


'Initialization Connection Properties

'Manadatory for SQL2005...other may differ


oCompany.Server = txtServer.Text

oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005

oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English

oCompany.UseTrusted = True

oCompany.UserName = txtUser.Text

oCompany.Password = txtPassword.Text


'Create a list of companies


oRecordSet = oCompany.GetCompanyList