Shouldn't you be using the function like this
Code:
SQLStr = "SELECT dbo.GetCustomerID('" + IPAddr + "')"