infopathproject in Visual Studio

G

Ger

Hi all,

When I open an infopathproject in Visual Studio and want to add some code to
a button on a InfoPath-form, like this:

Public Sub CTRL11_5_OnClick(ByVal e As DocActionEvent)
Dim ConnectionString As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Ontwikkel\G\Ger\Nummers.mdb;"
Dim Conn1 As OleDbConnection = New
OleDbConnection(ConnectionString)
Dim Comm1 As OleDbCommand = New OleDbCommand("UPDATE
Opdrachtnummers SET Opdrachtnummer = Opdrachtnummer + 1")
End Sub

I got the following error:

System.Security.SecurityException
Request failed.
at InfoPathProject4.InfoPathProject4.CTRL11_5_OnClick(DocActionEvent e)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

This happens on the dimensions of Conn1 and/or Comm1. What can be wrong ?
Help is appreciated.

Regards, Ger.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top