All posts by rogue lj

Sharepoint Error

SharePoint Error

Ok, so I gotta vent. This is frustrating:

“The list cannot be imported because a Microsoft SharePoint Foundation-compatible spreadsheet application is not installed or is not compatible with your browser.”
 

I’m using:

Microsoft Sharepoint Foundation 2010

Microsoft Internet Explorer 8

Microsoft Excel 2010

 

I’ll get back to you once i’ve found out how to sort this nonsense.

Toybox A4 Code

As promised, more code! This time for the Toybox A4 canvas demo page I created.





	
	Toybox A4

	




	




SAP Business One Connection

SAPbobsCOM Company

In the first of (hopefully) many (providing I keep the momentum going) posts regarding coding, I have documented the VB.NET code required to connect and return a SAP Business One Company. So here we go.

    Private Function Company(server As String, userName As String, SecurePW As Security.SecureString, _
                             companyDB As String, dbUsername As String, dbPassword As String, _
                             ByRef errorMsg As String) As SAPbobsCOM.Company

        Company = New SAPbobsCOM.Company

        ' Get the secure password 
        Dim ptr As IntPtr = Runtime.InteropServices.Marshal.SecureStringToBSTR(SecurePW)

        ' Set up the connection to SAP 
        Dim returnCode, errorCode As Integer
        With Company
            .Server = server
            .CompanyDB = companyDB
            .UserName = userName
            .Password = Runtime.InteropServices.Marshal.PtrToStringBSTR(ptr)
            .language = SAPbobsCOM.BoSuppLangs.ln_English
            .DbUserName = dbUsername
            .DbPassword = dbPassword
            .UseTrusted = False
            .DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2008

        End With

        ' Try and connect to the database 

        returnCode = Company.Connect
        If returnCode = 0 AndAlso Company.Connected = True Then
            ' Success! 
        Else
            Company.GetLastError(errorCode, errorMsg)
            If Company.Connected Then Company.Disconnect()
            Company = Nothing
        End If

    End Function

We’re assuming that we are connecting to a SQL Server 2008 instance. Also, the SAP User password is passed in via a SecureString for maximum security. I’ll post the code for a login form that exposes the SecureString password at a later date.