Writing/Saving data to attached database table. - InfoPath Dev
in

InfoPath Dev

Writing/Saving data to attached database table.

Last post 05-10-2013 07:58 AM by wlfringer. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-09-2013 11:51 AM

    Writing/Saving data to attached database table.

    Hello,

    I have created a new configuartion using the DBXL Admin Tool.  After publishing my solution I noticed that even though I am not getting any shredding errors, my data is not writing to the data tables assoicated with the main connection,  Can anyone direct me in where I have made a mistake or what I might be missing.  I am using the code below to submit my form to DBXL (see below).  Am I missing something in my routine?  Do I need to issue a thisXDocument.Submit to comitt my data to the database tables? 

    Private Function SubmitDocumentToDBXL() As Boolean

    Dim dataConnectionName, docTypeName, xmlToSubmit, docID As String

    Dim submitDocumenttoDBXLDOM As Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMDocument2

    dataConnectionName = GetNodeValue(GetNode(formLogicDom, "/FormLogic/DBXL/DataConnectionName"), "")

    docTypeName = GetNodeValue(GetNode(formLogicDom, "/FormLogic/DBXL/Doctype"), "")

    xmlToSubmit = thisXDocument.DOM.xml

    If (dataConnectionName.Length = 0 Or docTypeName.Length = 0) Then

    Return False

    End If

    submitDocumenttoDBXLDOM = GetDom(dataConnectionName, dbxlFormNameSpaces)

    SetNodeValue(GetNode(submitDocumenttoDBXLDOM,
    "/dfs:myFields/dfs:queryFields/tns:SubmitDocument/tns:docTypeName"), docTypeName)

    SetNodeValue(GetNode(submitDocumenttoDBXLDOM, "/dfs:myFields/dfs:queryFields/tns:SubmitDocument/tns:xml"), xmlToSubmit)

    Dim name, author, description As String

    name = String.Format("{0} {1}", thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:FastTrak/@StayID").text, "Screen")

    author = thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:FastTrak/@ScreenedBy").text

    description = String.Format("{0} {1} {2}", thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:FastTrak/@StayID").text, "Screen", thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:FastTrak/@Contact").text)

    SetNodeValue(GetNode(submitDocumenttoDBXLDOM, "/dfs:myFields/dfs:queryFields/tns:SubmitDocument/tns:name"), name)

    SetNodeValue(GetNode(submitDocumenttoDBXLDOM, "/dfs:myFields/dfs:queryFields/tns:SubmitDocument/tns:author"), author)

    SetNodeValue(GetNode(submitDocumenttoDBXLDOM, "/dfs:myFields/dfs:queryFields/tns:SubmitDocument/tns:description"), description)

    Dim WebServiceAdapter As WebServiceAdapter2

    Try

    WebServiceAdapter = thisXDocument.DataAdapters(dataConnectionName)

    WebServiceAdapter.Query()

    docID = GetNodeValue(GetNode(submitDocumenttoDBXLDOM,
    "/dfs:myFields/dfs:dataFields/tns:SubmitDocumentResponse/tns:docId"), "0")

    SetNodeValue(GetNode(formLogicDom, "/FormLogic/DBXL/DocId"), docID)

    Catch ex As Exception

    Dim CouldNotSubmitToDBXLError As String

    CouldNotSubmitToDBXLError = GetNodeValue(GetNode(formLogicDom, "/FormLogic/DBXL/CouldNotSubmitError"), "")

    MsgBox(CouldNotSubmitToDBXLError & vbCrLf & ex.Message)

    Return False

    End Try

    Return True

    End Function

    William L Fringer
    Database Administrator/Systems Integration Specialist
    L&S Associates, A Human Arc Company
    Phone: 800.766.6185, x6605| Fax: 800.698.2877
    3245 Technology Blvd | Lansing, MI 48910
    [email protected] | www.lsaservices.com
  • 05-10-2013 07:58 AM In reply to

    Re: Writing/Saving data to attached database table.

    My issue has been resolved.  I discovered that the Catalog file in my solution was different than the main data connection in my form.  I did not catch the error b/c the table names were the same in two different databases.

    Bill 

     

    William L Fringer
    Database Administrator/Systems Integration Specialist
    L&S Associates, A Human Arc Company
    Phone: 800.766.6185, x6605| Fax: 800.698.2877
    3245 Technology Blvd | Lansing, MI 48910
    [email protected] | www.lsaservices.com
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.