Catastrophic failure runtime error '-2147418113 (8000ffff)':

Very weird coz same application works on my machine but not on the targeted machine (winxp also - with sp1, while mine has service pack2)

I am trying to connect to a mysql database and I am not having any problems from my computer while I get this error message (see topic) when tested on other computer!

for connection I am using:

            With oConnection
                .ConnectionTimeout = 60 ' seconds
                .CommandTimeout = 5  'seconds
                .CursorLocation = adUseClient
                .Open "DSN=mySQLDB"
            End With

for recordset I use:

                Set rsClients = New ADODB.Recordset                
                rsClients.CursorType = adOpenKeyset
                rsClients.LockType = adLockBatchOptimistic
                rsClients.Open "SELECT * FROM Users", oConnection, , , adCmdText

remember this works on my comp, but not on target pc.

And I've installed MDAC 2.8 on target pc, so I don't know what the problem is!

Berhan KaragoezCreatorAsked:
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.

Berhan KaragoezCreatorAuthor Commented:
EH forgot to ask question :
How do I solve it?
Database connections must be made through either "system DSN's" (Data Source Names) or "File DSN's" and this is usually a result of an incorrectly formed DSN.

So, make sure you have a correct DSN set up, cn.Open "YOUR-DSN-NAME", etc. and it should work ok.

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
p.s., that's probably what you forgot to do on your target machine, & you usually setup DSN's through the ODBC or equivalent panel.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Berhan KaragoezCreatorAuthor Commented:
nope, odbc connection works from the other computer as well!

only my code fails on the other computer, it works from here as well.

But I'll try the system dsn connectiion, just because I haven't tried it.

Mind that DSN=mySQLDB exists on both computers and they point to an mysql database with ipnr and login/pass.

so the odbc connections work from BOTH computers.

The code to open a connection to database (on other computer fails and generates error message!

Berhan KaragoezCreatorAuthor Commented:
found it!

had to do with drivers!

please close question!
I was wondering what the specific solution was, if you remember.
Berhan KaragoezCreatorAuthor Commented:
Yes, it was the new odbc driver for mySQL causing the problem - an older version made it work perfectly!!

Berhan K.
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
Visual Basic Classic

From novice to tech pro — start learning today.