无法启动您的应用程序。工作组信息文件丢失或由其他用户独占打开 [英] Cannot start your application. The workgroup information file is missing or opened exclusively by another user

查看:97
本文介绍了无法启动您的应用程序。工作组信息文件丢失或由其他用户独占打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在尝试从c#连接Ms-Access,但它返回错误。



你能告诉我哪里出错吗?



Hi all,

I'm trying to connect Ms-Access from c#, but it's returning an error.

Can you tell me where I went wrong?

connection_string = @"Provider=Microsoft.ACE.OLEDB.12.0;password=pass@word1;Data Source=C:\Users\bojjaiah\Documents\bojjaiah\Databases\college.accdb;";





错误:



无法启动您的申请。工作组信息文件丢失或由其他用户专门打开



提前感谢。



error:

Cannot start your application. The workgroup information file is missing or opened exclusively by another user

thanks in advance.

推荐答案

查看以下提供的帮助: http://social.msdn.microsoft.com/Forums/windows/en-US/2cdb0394-b757-4b4c-96e6- 927100d8eebd /无法启动您的应用程序 - 工作组 - 信息 - 文件丢失或打开独占 [ ^ ]



如果有帮助,请告诉我们。
Look into the help provided at: http://social.msdn.microsoft.com/Forums/windows/en-US/2cdb0394-b757-4b4c-96e6-927100d8eebd/cannot-start-your-applicationthe-workgroup-information-file-is-missing-or-opened-exclusively-by[^]

Let us know if this helps.


此错误是由我认为 2个原因

------------------- -----------------------------

1.使用ODBC密码格式化连接字符串而不是OleBD格式化连接字符串。



ODBC

DSN = Organization_DB; dbq = C:\DATAFOLDER \ MNI \mnitest \ Orgg_Client_DB.accdb ; driverid = 25; fil = MS Access; maxbuffersize = 2048; pagetimeout = 5; uid = admin; Pwd = xxxxxxxx}



等效OleDB

Provider = Microsoft.ACE.OLEDB.15.0; Data Source = C:\DATAFOLDER \MNI\mnitest\Org_Client_DB.accdb; User ID = admin; Jet OLEDB:Encrypt Database = True; Jet OLEDB:Database Password = xxxxxxxx



2.如果数据库使用2010-2013格式加密,请在连接字符串中设置加密标志

Jet OLEDB :加密数据库=真;



---------------------------- --------------------

之后,连接应该可以正常工作。



这对我有用。
This error is caused by 2 reasons in my opinion
------------------------------------------------
1. Using ODBC password formatted connection string instead of the OleBD formatted connection string.

ODBC
DSN=Organization_DB;dbq=C:\DATAFOLDER\MNI\mnitest\Org_Client_DB.accdb;driverid=25;fil=MS Access;maxbuffersize=2048;pagetimeout=5;uid=admin;Pwd=xxxxxxxx}

Equivalent OleDB
Provider=Microsoft.ACE.OLEDB.15.0;Data Source=C:\DATAFOLDER\MNI\mnitest\Org_Client_DB.accdb;User ID=admin;Jet OLEDB:Encrypt Database=True;Jet OLEDB:Database Password=xxxxxxxx"

2. If the database is encypted using 2010-2013 format, set the encryption flag in the connection string
Jet OLEDB:Encrypt Database=True;

------------------------------------------------
After, this the connection should work just fine.

This is what worked for me.


此外,您还需要从正确的命名空间中实现命令,适配器和连接< b> Data.OleDb

请参阅以下工作解决方案的摘录(..不是完整的课程)





In addition you need to instanciate Commands, Adaptors and Connections from the correct namespace Data.OleDb
See extracts from a working solution below ( .. not a complete class)


Public Class ClientLogicOdbc
    Private DataBaseMessage As String
	Private CmdConnect As System.Data.OleDb.OleDbConnection
    Private CmdKPIList As System.Data.OleDb.OleDbCommand
    Private DaTable As System.Data.OleDb.OleDbDataAdapter
	Private TbKPIList As New System.Data.DataTable
    Private TbKPIRow As System.Data.DataRow
	
	Public Sub New()
      Client_Data_Logged = New ClientData
      DbConnectivity = DatabaseConnectivity.NotConnected
      ConnString = ReadConnectionSetting("CompanyConnectionOleDb")   
	  Call Connect()	  
    End Sub
	
	Private Sub Connect()
      Try
        CmdConnect = New System.Data.OleDb.OleDbConnection(ConnString)
        CmdKPIList = New System.Data.OleDb.OleDbCommand()
        CmdConnect.ConnectionString = ConnString
        CmdConnect.Open()
        DbConnectivity = DatabaseConnectivity.Connected
      Catch ex As Exception
        Me.LocalException = ex        
        Call RaiseErrorMessage(ex.Message, ex)
        DbConnectivity = DatabaseConnectivity.Faulted
        Debug.Print(ex.Message)
      End Try
    End Sub
	
	Public Function Company_File_Exists(ByVal ReportListing As ClientData) As Boolean
      Dim Found As Boolean = False
      Dim DatabaseMessage As String
      TbKPIList = New Data.DataTable
      If DbConnectivity = DatabaseConnectivity.Connected Then
        Try
          DatabaseMessage = "Select dbo_Company_Files.Imported From dbo_Company_Files where dbo_Company_Files.Filename='" & ReportListing.name & "' and dbo_Company_Files.startTime=#" & ReportListing.startTime.ToString("yyyy-MM-dd hh:mm:ss") & "# and dbo_Company_Files.EndTime=#" & ReportListing.endTime.ToString("yyyy-MM-dd hh:mm:ss") & "# ;"
          DaTable = New Data.OleDb.OleDbDataAdapter(DatabaseMessage, CmdConnect)
          DaTable.Fill(TbKPIList)
          TbKPIList.TableName = "dbo_Company_Files"

          If TbKPIList.Rows.Count > 0 Then
            Found = True
          End If
        Catch ex As Exception
          LocalException = ex
        Finally
          If Not TbKPIList Is Nothing Then
            TbKPIList.Clear()
            TbKPIList = Nothing
          End If
          If Not DaTable Is Nothing Then
            DaTable.Dispose()
            DaTable = Nothing
          End If
        End Try
      End If
      Return Found
    End Function
	
	
	Public Function ReadConnectionSetting(ByVal key As String) As String
      Dim result As String = ""
      Dim ConnStringSetting As System.Configuration.ConnectionStringSettings
      Try
        Dim app_Conn_Settings As System.Configuration.ConnectionStringSettingsCollection =
             System.Configuration.ConfigurationManager.ConnectionStrings

        ConnStringSetting = app_Conn_Settings(key)
        If IsNothing(ConnStringSetting) Then
          result = ""
        Else
          result = ConnStringSetting.ConnectionString
        End If
        
      Catch ex As System.Configuration.ConfigurationErrorsException

      End Try
      Return result
    End Function
	
End Class


这篇关于无法启动您的应用程序。工作组信息文件丢失或由其他用户独占打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆