How to read .iif file of Quickbooks using vb or any code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raghu Gupta

    How to read .iif file of Quickbooks using vb or any code

    Hi,
    Actually i am facing some problem using quickbooks and presently i am
    not so expert in using it.

    I am using c# code to retrive the data from quickbooks.
    it doesn't matter which language we are using.
    So i have .iif file of employee list,so through code i have to read .iif
    file and get the data out of it and store that data in database.

    As i can use QuickBook only to import .iif file and from quickbook i can
    read the data, but there will be many .iif files, so i should read it
    dynamically and store it in database.And there should be no intervention
    of QuickBook SDK in this process.

    so my problem is,i need quickbook sdk code such that i can read .iif
    file and retrive the data.

    so, please can u help me with any suggestions or any good tutorials
    concerned to this.

    Thank you,

    Regards,
    Raghu

    *** Sent via Developersdex http://www.developersdex.com ***
  • rude person

    #2
    Re: How to read .iif file of Quickbooks using vb or any code

    On Mon, 12 Sep 2005 11:44:07 GMT, Raghu Gupta <ambatigupta@ya hoo.com> wrote:
    [color=blue]
    >Hi,
    >Actually i am facing some problem using quickbooks and presently i am
    >not so expert in using it.
    >
    >I am using c# code to retrive the data from quickbooks.
    >it doesn't matter which language we are using.
    >So i have .iif file of employee list,so through code i have to read .iif
    >file and get the data out of it and store that data in database.
    >
    >As i can use QuickBook only to import .iif file and from quickbook i can
    >read the data, but there will be many .iif files, so i should read it
    >dynamically and store it in database.And there should be no intervention
    >of QuickBook SDK in this process.
    >
    >so my problem is,i need quickbook sdk code such that i can read .iif
    >file and retrive the data.
    >
    >so, please can u help me with any suggestions or any good tutorials
    >concerned to this.
    >
    >Thank you,
    >
    >Regards,
    >Raghu
    >
    >*** Sent via Developersdex http://www.developersdex.com ***[/color]

    Hi
    you could try posting in alt.comp.softwa re.financial.qu ickbooks which seems to be an active group

    Comment

    • bc3

      #3
      Re: How to read .iif file of Quickbooks using vb or any code

      rude person wrote:
      [color=blue]
      > On Mon, 12 Sep 2005 11:44:07 GMT, Raghu Gupta <ambatigupta@ya hoo.com> wrote:
      >
      >[color=green]
      >>Hi,
      >>Actually i am facing some problem using quickbooks and presently i am
      >>not so expert in using it.
      >>
      >>I am using c# code to retrive the data from quickbooks.
      >>it doesn't matter which language we are using.
      >>So i have .iif file of employee list,so through code i have to read .iif
      >>file and get the data out of it and store that data in database.
      >>
      >>As i can use QuickBook only to import .iif file and from quickbook i can
      >>read the data, but there will be many .iif files, so i should read it
      >>dynamically and store it in database.And there should be no intervention
      >>of QuickBook SDK in this process.
      >>
      >>so my problem is,i need quickbook sdk code such that i can read .iif
      >>file and retrive the data.
      >>
      >>so, please can u help me with any suggestions or any good tutorials
      >>concerned to this.
      >>
      >>Thank you,
      >>
      >>Regards,
      >>Raghu
      >>
      >>*** Sent via Developersdex http://www.developersdex.com ***[/color]
      >
      >
      > Hi
      > you could try posting in alt.comp.softwa re.financial.qu ickbooks which seems to be an active group
      >[/color]
      ' Parse response XML from QuickBooks using MSXML parser
      Public Function ParseResponseXM L(elementName As String) As Boolean

      On Error GoTo ErrHandler

      resListID = ""

      Dim retStatusCode As String
      Dim retStatusMessag e As String
      Dim retStatusSeveri ty As String

      ' Create xmlDoc Obj

      ' DOM Document Object
      Dim xmlDoc As New MSXML2.DOMDocum ent40

      ' DOM Node list object for looping through
      Dim objNodeList As IXMLDOMNodeList

      ' Node objects
      Dim objChild As IXMLDOMNode
      Dim custChildNode As IXMLDOMNode
      Dim invoiceChildNod e As IXMLDOMNode

      ' Attributes Name Mapping
      Dim attrNamedNodeMa p As IXMLDOMNamedNod eMap

      Dim i As Integer
      Dim ret As Boolean
      Dim errorMsg As String

      errorMsg = ""

      ' Load xml doc
      ret = xmlDoc.loadXML( responseXML)
      If Not ret Then
      errorMsg = "loadXML failed, reason: " & xmlDoc.parseErr or.Reason
      GoTo ErrHandler
      End If

      ' Get nodes list
      Set objNodeList = xmlDoc.getEleme ntsByTagName(el ementName)

      ' Loop through each node
      ' Since we have only one request, we should only have one
      ' response. The loop is actually unnecessary, but it
      ' is a good programming practice
      For i = 0 To (objNodeList.le ngth - 1)

      ' Get the CustomerRetRs
      Set attrNamedNodeMa p = objNodeList.Ite m(i).Attributes

      ' Get the status Code, info and Severity
      '
      retStatusCode =
      attrNamedNodeMa p.getNamedItem( "statusCode").n odeValue
      retStatusSeveri ty =
      attrNamedNodeMa p.getNamedItem( "statusSeverity ").nodeValu e
      retStatusMessag e =
      attrNamedNodeMa p.getNamedItem( "statusMessage" ).nodeValue

      ' Check status code to see if there is error or warning
      If retStatusCode <> "0" Then
      ' Checking for Warning is a good practice, although
      unlikely to happen
      ' on an add request.
      If retStatusSeveri ty = "Warning" Then
      ' Show the warning, then continue normal processing
      MsgBox retStatusMessag e, vbExclamation, "Warning from
      QuickBooks"
      ElseIf retStatusSeveri ty = "Error" Then
      MsgBox retStatusMessag e, vbExclamation, "Error from
      QuickBooks"
      ' We only have one response thus we will exit. If we
      have multiple
      ' responses, then we may want to continue with the loop.
      ParseResponseXM L = False
      Exit Function
      End If
      End If

      ' Look at the child nodes
      For Each objChild In objNodeList.Ite m(i).childNodes

      ' Get the CustomerRet block if we were adding a customer
      If objChild.nodeNa me = "CustomerRe t" Then

      ' Get the elements in this block
      For Each custChildNode In objChild.childN odes
      If custChildNode.n odeName = "ListID" Then
      resListID = custChildNode.T ext
      ElseIf custChildNode.n odeName = "Name" Then
      resCustName = custChildNode.T ext
      ElseIf custChildNode.n odeName = "FullName" Then
      resCustFullName = custChildNode.T ext
      End If
      Next

      End If ' End of customerRet


      ' Get the "InvoiceQueryRe t" if we were looking for
      ' an in-use customer by querying for invoices -- if
      ' we find one of these, we'll have all the information
      ' we need and can then break from the function.
      If objChild.nodeNa me = "InvoiceRet " Then

      For Each invoiceChildNod e In objChild.childN odes
      If invoiceChildNod e.nodeName = "CustomerRe f" Then

      ' Get the elements in this block
      For Each custChildNode In
      invoiceChildNod e.childNodes
      If custChildNode.n odeName = "ListID" Then
      resListID = custChildNode.T ext
      ElseIf custChildNode.n odeName = "Name" Then
      resCustName = custChildNode.T ext
      ElseIf custChildNode.n odeName = "FullName" Then
      resCustFullName = custChildNode.T ext
      End If
      Next

      ' If we get here, we have all the information
      we need
      GoTo BreakPoint

      End If
      Next

      End If ' end of InvoiceQueryRet


      ' Get the Customer Name if we were deleting a customer
      If elementName = "ListDelRs" And objChild.nodeNa me =
      "FullName" Then
      custName = objChild.Text
      End If ' end of ListDelType


      Next
      Next

      BreakPoint:
      ParseResponseXM L = True
      Exit Function

      ErrHandler:
      If errorMsg <> "" Then
      MsgBox errorMsg, vbExclamation, "Error"
      Else
      MsgBox Err.Description , vbExclamation, "Error"
      End If
      ParseResponseXM L = False
      Exit Function

      End Function

      Comment

      Working...