Wednesday, January 2, 2013

Access PB Code in VB

Dim PBObject As Object
Dim Taxuo As Object
Dim GrossPay as Integer
Dim TaxRate as Integer
 `Connect to the tax object
Set PBObject = CreateObject("PowerBuilder.Application")
If pbobject Is Nothing Then
   MsgBox "Create of PB object failed"
   End Sub
Else
   PBObject.LibraryList = "c:\pbi32\tax.pbd"
   Set Taxuo = PBObject.CreateObject("u_tax_calc")
   If Taxuo Is Nothing Then
      MsgBox "tax uo failed"
      End Sub
   Else
      `Call the tax bracket function
      TaxRate = Taxuo.uf_Tax (GrossPay)
      Set Taxuo = Nothing
   End If
   Set pbobject = Nothing
End If

No comments:

Post a Comment