hi, may i know how to solve this problem?
at first, i have attach the form with visual studio.net because i am using vb.net to connect .mdb
all work ok.
but since i want the form be stand alone (because i don't want other people see the coding as well.) so i am trying to publish the as mak.xsn in C drive into same laptop.
but once i press the submit button, it can't work.
error message is form code error.
Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.PermissionSet.Demand()
at System.Data.Common.DbConnectionOptions.DemandPermission()
at System.Data.OleDb.OleDbConnection.PermissionDemand()
at System.Data.OleDb.OleDbConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at InfoPathProject3.InfoPathProject3.AddRecord(DateTime Date_Apply, Int32 StaffNo, DateTime LeaveAppliedFrom, DateTime LeaveAppliedTo, Int32 DaysLeaveApplied, Int32 Nature_Leave_ID, Int32 ApprovedBy, DateTime ApprovedDate, Int32 Status_ID)
at InfoPathProject3.InfoPathProject3.CTRLSubmit_OnClick(DocActionEvent e)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
then i need to select "design a form" from file menu and choose to design this form. after that, i have to press "PREVIEW BUTTON" and key in the detail, follow by press the "SUBMIT" button. then it only allowed me to save record into .mdb.
so who can give some opinion to skip the step.
because i just want the user click on the template then can fill in and submit directly. without going to design mode and preview then only can key in and save.