0

我通過使用Windows Form Application與C#創建了一個簡單安裝項目,它只在數據庫中插入數據。 我的數據庫在Ms Access.First我嘗試將它安裝在我自己的計算機上它工作的很好,它將所有驅動器安裝在任何位置並正常工作。 在我的另一臺電腦中有4個驅動器C,D,E,F。 問題是,當我將它安裝到我的另一臺計算機時,它安裝在所有驅動器(C,D,E,F)中,並且也運行,但是當它安裝在C驅動器上時,安裝成功,運行成功,但是當我單擊插入按鈕它給我的錯誤和完整的錯誤是:Windows窗體應用程序C#安裝程序項目錯誤

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box. 

************** Exception Text ************** 
System.Data.OleDb.OleDbException (0x80004005): Operation must use an 
updateable query. 
    at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult 
hr) 
    at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS 
dbParams, Object& executeResult) 
    at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) 
    at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior 
behavior, Object& executeResult) 
    at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior 
behavior, String method) 
    at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() 
    at Management.Form1.button1_Click(Object sender, EventArgs e) 
    at System.Windows.Forms.Control.OnClick(EventArgs e) 
    at System.Windows.Forms.Button.OnClick(EventArgs e) 
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) 
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons 
button, Int32 clicks) 
    at System.Windows.Forms.Control.WndProc(Message& m) 
    at System.Windows.Forms.ButtonBase.WndProc(Message& m) 
    at System.Windows.Forms.Button.WndProc(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 
msg, IntPtr wparam, IntPtr lparam) 


************** Loaded Assemblies ************** 
mscorlib 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.34014 built by: FX45W81RTMGDR 
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll 
---------------------------------------- 
Management 
    Assembly Version: 1.0.0.0 
    Win32 Version: 1.0.0.0 
    CodeBase: file:///C:/Program%20Files/Vikram%20Manufacture/Access%20Product/Management.exe 
---------------------------------------- 
System.Windows.Forms 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll 
---------------------------------------- 
System.Drawing 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll 
---------------------------------------- 
System 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.34003 built by: FX45W81RTMGDR 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll 
---------------------------------------- 
System.Configuration 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll 
---------------------------------------- 
System.Data 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll 
---------------------------------------- 
System.Core 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll 
---------------------------------------- 
System.Xml 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll 
---------------------------------------- 
System.Transactions 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll 
---------------------------------------- 
System.EnterpriseServices 
    Assembly Version: 4.0.0.0 
    Win32 Version: 4.0.30319.33440 built by: FX45W81RTMREL 
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll 
---------------------------------------- 

************** JIT Debugging ************** 
To enable just-in-time (JIT) debugging, the .config file for this 
application or computer (machine.config) must have the 
jitDebugging value set in the system.windows.forms section. 
The application must also be compiled with debugging 
enabled. 

For example: 

<configuration> 
    <system.windows.forms jitDebugging="true" /> 
</configuration> 

When JIT debugging is enabled, any unhandled exception 
will be sent to the JIT debugger registered on the computer 
rather than be handled by this dialog box. 

我使用Visual Studio 2010,Windows窗體應用程序C#,數據庫的MS Access 2013年

+0

試試我發佈的內容 – 2014-09-21 19:38:00

回答

0

試試這個:

可以force your program to run in Administrator mode

您需要修改程序中嵌入的清單。這適用於VS2008及更高版本:項目+添加新項目,選擇「應用程序清單文件」。更改<requestedExecutionLevel>元素:

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> 
0

只需啓動你的應用程序,右擊Administrator並以管理員身份運行。或完全禁用Windows的UAC設置。

相關問題