security exception opening an Access database from an InfoPath form

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
 
B

Brendan Reynolds

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
 

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