0

I have this connection string

strConnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\mydb.accdr;Persist Security Info=False;"

When I try to open the connection, I get this error:

Multiple-step OLE DB operation generated errors"

when opening ADO connection.
I tried all possible solutions found on Google, but no success. Registry is fine.

Any advice?

Here is how I use the code: (cn is a global ADODB.Connection)

Set cn = New ADODB.Connection
cn.Open strConnect, "Admin", ""

PC is running windows XP with no MS Office installed.

EDIT

I have tested the connection string outside of the application and it works fine. just doesn't want to connect when opening the connection from code.

Also had a look at http://www.adopenstatic.com/faq/80040e21.asp, seems my issue is scenario 2 but still no idea how to fix it.

Other references I looked at, but where not helpful are: https://support.microsoft.com/en-us/kb/269495

Stephen
  • 1,532
  • 1
  • 9
  • 17

2 Answers2

0

Maybe you should post more of the code, like how you use that string. Also you could try "Source=C:\mydb.accdr". There should bei 2x "\". I still don´t get it why the reader cuts this away. Or write an example program, where you try to connect to another testing database, to see if it really works fine.

Garamaru
  • 106
  • 1
  • 1
  • 11
  • Shouldn´t it be more like this: private ADODB.Connection cn = new ADODB.Connection(); and if it´s like the oledb stuff, maybe you need to just do cn.Open(strConnect, null, null, 0); [link]https://support.microsoft.com/en-us/kb/308611[/link] maybe helps. there´s an example, but i´m not into that adodb stuff, i only do some stuff with the oledb stuff for an exam... – Garamaru Jun 30 '15 at 14:28
  • I need to also add that this only happens on one pc. works fine on others – Stephen Jul 01 '15 at 06:05
  • then must be Provider=Microsoft.ACE.OLEDB.12.0 be missing on that machine or not correctly adressed. – Garamaru Jul 02 '15 at 16:40
0

Apparently my connection string was the problem, had a property that is not supported. It should be like this:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\mydb.accdr;

without the Persist Security Info=False; which is not supported.

Hope somebody finds this helpful.

Stephen
  • 1,532
  • 1
  • 9
  • 17