qJake
qJake

Reputation: 17139

VB6/ADO: "Method Open of object _Connection failed"

Here's the software involved:

The error message in its entirety:

-2147467259: Method 'Open' of object '_Connection' failed

Source: Microsoft SQL Server Compact Edition OLE DB Provider

The connection string being used is:

Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0;Data Source='C:\Path\To\TheDatabase.sdf';

The password is provided like so:

myDBConnection.Properties("SSCE:Database Password") = "********"

The error appears when the "Open" function is called on the ADODB.Connection object.

I've re-installed Windows, re-installed Office, re-installed MSSQL CE 2005, and nothing seems to work. Here's the best part, though: Some of my coworkers have Windows Vista with this exact same code, and when they run it, it doesn't error for them. So this means that something local to this machine is causing this problem.

If anyone has any suggestions on what I could try to fix this problem, I'd really appreciate it.

Upvotes: 2

Views: 2742

Answers (1)

qJake
qJake

Reputation: 17139

Wow, nevermind... turns out the file didn't exist. What a crappy error message. You'd think it would have said "File not found" or something like that.

Ordinarily I would have checked for the file, but the folder was under subversion control so I didn't bother to check. The lesson here: Don't always trust your SVN repo ;)

Upvotes: 2

Related Questions