0
  • Getting Unspecified error on windows XP with office 2010.
  • issue is reproducible on some machine not all.

Code

  Dim dbConn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\test\data.mdb")
   try
   {
   dbConn.Open() 
   }

Exception

Exception:   at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString   constr, OleDbConnection connection)
   at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions    options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   at    System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection    owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.OleDb.OleDbConnection.Open()
Sandip
  • 3,501
  • 3
  • 19
  • 23
  • Can you provide the exact message? Question: Affected machines are 32 bit or 64 bit? – Adriano Repetti Apr 19 '12 at 09:06
  • This may be of interest, but it is not an ideal solution http://stackoverflow.com/questions/4050559/system-data-oledb-oledbconnectioninternal-ctor-unspecified-error – Fionnuala Apr 19 '12 at 09:38
  • Don't know if this is your case, so I will post as comment but the drivers for ACE.OLEDB comes in two versions x64 and x32. If your application is compiled with the AmyCPU flag then, on 64 bit machine will use the x64 drivers and they should be present. If you compile your application with the x86 flag then, on 64 bit machine will use the x86 drivers. – Steve Apr 19 '12 at 10:09
  • It's on 32 bit XP machine.. office 2010 is installed – Sandip Apr 19 '12 at 12:24
  • Unspecified error that's the error comes – Sandip Apr 19 '12 at 12:25

1 Answers1

-2

try this

Dim dbConn As  OLEDBConnection
Set dbConn = New Connection
dbConn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\test\data.mdb;"

You need to declare dcConn and then set it in separate statements.

Heman
  • 118
  • 1
  • 3
  • 8