security exception opening an Access database from an InfoPath form

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

I have an InfoPath form that needs to update an Access database. So
far i can't even open it: the database is on my hard drive, and no
password is set. The
following is the code in my onLoad event on the InfoPath form. (I've
tried it w/out the User ID and password and get the same error.


Dim strConnection As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& "C:\My_Data\New Jersey Fees.mdb"
& "User ID=Admin" _
& "Password="
Dim cn As OleDbConnection = New
OleDbConnection(strConnection)
cn.Open()


Error:


System.Security.SecurityException
Request failed.
at
New_Jersey_Request_and_Replies.New_Jersey_Request_and_Replies.OnLoad(DocRet­
urnEvent
e)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper­.OnLoad(DocReturnEvent
pEvent)


do i have to digitally sign the form?

any ideas?

thanks
 
Check that the identity under which the code runs has read, write, and
delete permissions on the folder that contains the MDB.

--
Brendan Reynolds

I have an InfoPath form that needs to update an Access database. So
far i can't even open it: the database is on my hard drive, and no
password is set. The
following is the code in my onLoad event on the InfoPath form. (I've
tried it w/out the User ID and password and get the same error.


Dim strConnection As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" _
& "C:\My_Data\New Jersey Fees.mdb"
& "User ID=Admin" _
& "Password="
Dim cn As OleDbConnection = New
OleDbConnection(strConnection)
cn.Open()


Error:


System.Security.SecurityException
Request failed.
at
New_Jersey_Request_and_Replies.New_Jersey_Request_and_Replies.OnLoad(DocRet­
urnEvent
e)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper­.OnLoad(DocReturnEvent
pEvent)


do i have to digitally sign the form?

any ideas?

thanks
 
Back
Top