Solved

Getting server create object failed when setting MySQL ODBC connection

Posted on 2014-09-10
10
1,428 Views
Last Modified: 2014-09-10
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"
0
Comment
Question by:dssisupport
  • 5
  • 4
10 Comments
 
LVL 33

Expert Comment

by:Big Monty
ID: 40314967
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
 

Author Comment

by:dssisupport
ID: 40315019
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
 
LVL 33

Expert Comment

by:Big Monty
ID: 40315025
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 40315055
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
 

Author Comment

by:dssisupport
ID: 40315080
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
 
LVL 33

Expert Comment

by:Big Monty
ID: 40315093
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
 

Author Comment

by:dssisupport
ID: 40315436
I will give it a shot but wouldn't that affect my SQL Server connection string as well?
0
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 40315443
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
 

Author Comment

by:dssisupport
ID: 40315524
Ok, I installed the MDAC from the link but unfortunately still get the same error.
0
 

Author Comment

by:dssisupport
ID: 40315595
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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Have issues with Query MySQL 9 64
File download script VBSCRIPT fail on download PPT files 2 51
MySQL  on Tomcat 8 45
mysql disables rename 4 68
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question