Excel VBA Error &H80004005 (-2147467259) SQLOLEDB

I have a spreadsheet with VBA code that is crashing on one of my laptops.  It crashes at the "cnASC.Open" line and gives the following error message:

"System Error &H80004005 (-2147467259) unspecified error"

Dim cnASC As ADODB.Connection

cnASC.ConnectionString = "Provider=SQLOLEDB;Data Source=SAPPHIRE;Initial Catalog=asc_br;Integrated Security=SSPI;Auto Translate=False"
cnASC.Open

Open in new window


I have a sneaking suspicion that the provider might not exist on the laptop, and I've run MDAC_TYP.EXE on the laptop to try to remedy the situation, but to no avail.

I hope someone has a solution for me.  Thanks!
trbbhmAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Neil RussellTechnical Development LeadCommented:
Do you have an ODBC Datasource configured on that machine called SAPPHIRE ?
0
trbbhmAuthor Commented:
NEILSR:  No I do not, but I have another laptop that does NOT experience this error and it does not have one configured either.

The SAPPHIRE machine is just a SQL server (as I'm sure you are already aware).
0
Neil RussellTechnical Development LeadCommented:
Good, I also assume that the account you are logged in running from has all the correct credientials? That you can resolve SAPPHIRE from a command prompt?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Neil RussellTechnical Development LeadCommented:
Oh and your code SHOULD be..
Dim cnASC As new ADODB.Connection

cnASC.ConnectionString = "Provider=SQLOLEDB;Data Source=SAPPHIRE;Initial Catalog=asc_br;Integrated Security=SSPI;Auto Translate=False"
cnASC.Open

Open in new window

0
trbbhmAuthor Commented:
This was the key comment that spun the gears of thought into motion:

"account you are logged in running from has all the correct credientials?"

I did not have the specific user set up in the SQL database security settings!

Once I properly configured the user, everything worked fine.  Thank you, thank you, thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.