can't display data from .mdb when startup the form - InfoPath Dev
in

InfoPath Dev

can't display data from .mdb when startup the form

Last post 08-03-2006 09:20 AM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-02-2006 07:24 PM

    can't display data from .mdb when startup the form

    i am using vb.net to retrieve data from .mdb and display it into drop down list when startup the form. but now i have a problem to display the data.
    hope someone to advice.

    My Coding is shown as below.
    Dim strConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\eLeave.mdb"
    Dim cn As OleDbConnection = New OleDbConnection(strConnection)
    Dim strGetData As String
    Dim str As Object

    strGetData = "SELECT Name " & _
    " FROM tblStaffÅ  & _
    " WHERE Designation = 'Manager'"

    Dim strCommandRead As New OleDbCommand(strGetData, cn)

    cn.Open()

    str = strCommandRead.ExecuteReader()

    thisXDocument.DOM.selectSingleNode("//myFields:field1").text = str

    cn.Close()

    Error message
    The _Startup or _shutdown method in this form's code contains one or more calls to members of the microsoft.office.interop.infopath.semitrust namespace. calls to this namespace from these methods are not allowed.
  • 08-03-2006 09:20 AM In reply to

    Re: can't display data from .mdb when startup the form

    Do not put such code in the Startup method... place it in an OnLoad event handler.
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.