Getting server create object failed when setting MySQL ODBC connection

I am trying to setup an ODBC connection string in classic asp to a remote MySQL database and I keep getting the server.createobject failed error. I am running Windows 7 (64 bit) but IIS is set for 32 bit mode. I have installed latest MySQL ODBC connector driver (5.3.4) bot 32 and 64 bit versions. I am able to setup and test a system DSN connection to the remote MySQL database both from the control panel and from the odbad32.exe in the syswow64 folder so I know my credentials are correct. I can also connect using MySQL workbench with no problem. Here is an example of the connection string I am using. I have x'd out the server IP and login info for security reasons.  Something I am missing?

Dim mySQLConnect

Set mySQLConnect = Server.CreateObject("ADODB.Connection")
mySQLConnect.Open "DRIVER={MySQL ODBC 5.3 Unicode Driver}; SERVER=xx.xxx.xxx.xxx; PORT=65265; DATABASE=asteriskcdrdb; UID=xxxx;PASSWORD=xxxx; OPTION=3"
dssisupportAsked:
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.

Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
sounds like a permissions issue or even your mdac being corrupted. try re-installing the mdac package, which you can download from here:

http://www.microsoft.com/en-us/download/details.aspx?id=5793

some more info on the mdac:

http://msdn.microsoft.com/en-us/library/ms810805.aspx
0
dssisupportAuthor Commented:
Thanks for the quick response but I don't think MDAC is the problem because I also have a connection string to a local SQL express server that works perfectly. In this scenario I need to open two connection strings, One to my local SQL express server and one to the remote MySQL server. The local connection works just fine. If it was a permission issue I would assume that my DSN connection test would fail and MySQL workbench is also using the same connection info and credentials.
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
if you're getting a Server.CreateObject failed error message (as indicated by your title), then it's most likely what I suggested above. If you're getting a different error message, please post EXACTLY what that message is
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Take a look at the connection string options  http://www.connectionstrings.com/mysql-connector-odbc-5-2/

Driver={MySQL ODBC 5.2 ANSI Driver};Server=myServerAddress;Database=myDataBase;
User=myUsername;Password=myPassword;Option=3;

Driver={MySQL ODBC 5.2 ANSI Driver};Server=myServerAddress;Port=xxxx;
Database=myDataBase;User=myUsername;Password=myPassword;Option=3;

OLEDB
Server=myServerAddress;Port=xxxx;Database=myDataBase;Uid=myUsername;
Pwd=myPassword;
0
dssisupportAuthor Commented:
To Big_Monty: The link you provided for the MDAC is not for Windows 7 (64 bit) so that's not going to help. I don't think there is a direct download for the MDAC that is compatible with Windows 7. The exact error I am getting is ASP_0177_:_800401f3|Server.CreateObject_Failed.

To Scott: I had actually already went to that site to get the connection string and I have tried a few of them but all get the same error.
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
try the link below, it is for both 32 bit and 64 bit versions.

http://www.microsoft.com/en-us/download/details.aspx?id=21995

The error you're getting is not related to making an actual connection the database, but rather trying to access the DLL that Server.CreateObject uses. Usually re-installing the mdac resolves this issue, however if you're comfortable in the registry, you may look into this approach as well.
0
dssisupportAuthor Commented:
I will give it a shot but wouldn't that affect my SQL Server connection string as well?
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
no, not at all.

whenever you do a Server.CreateObject("xxx"), you're calling a dll that has been registered on the server. The connection string is a parameter you're passing to one of the functions within that object.
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
dssisupportAuthor Commented:
Ok, I installed the MDAC from the link but unfortunately still get the same error.
0
dssisupportAuthor Commented:
I am a complete moron... It wasn't the MySQL connection that was causing the error. There was another control further down in the page that didn't have it's dll registered correctly. It just seemed like it was the mysql because before I fixed the connection string I was getting another error so after I fixed the string then it was able to get past that code and then bomb. I apologize for the confusion but your statement about why the error was occurring did out me on the right track.

Thanks!
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
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.