Can't connect to an Access 2013 file in Visual Basic 2012 using code

1

It's just a simple Access 2013 file. I'm using this connection string:

Dim odbccn As New Data.Odbc.OdbcConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=access.accdb;Persist Security Info=False;")

Connecting to the same file using the data source explorer seems to work, and it even provides that same connection string. But doing it with code brings up this.

System.Data.Odbc.OdbcException (0x80131937): ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
database
vb.net
ms-access
visual-studio-2012
ms-access-2013
asked on Stack Overflow Sep 21, 2013 by SlashThingy • edited Sep 21, 2013 by SlashThingy

1 Answer

1

Fixed it. Didn't know there was a difference between OleDB and ODBC. Well, I'm an idiot.

answered on Stack Overflow Sep 21, 2013 by SlashThingy

User contributions licensed under CC BY-SA 3.0