IIS-8 and MySQL Server Settings

FYI - I have become somewhat of a Novice Web Developer being out of the game for several years. However, I NEED to get back into it for professional reasons now.

Question: How can I provide client access to my website through Classic ASP, on a .NET Framework, to a MySQL Database using ODBC connection string ?

I am working through a Web/Database PHP UI and have tried several times to manipulate the Web.Config file, collectively with a Database Connection String -using Driver 3.51 and 5.1 and neither are connecting me in order to Read/Write information to my Database. Some heads up, better yet, a solution would be greatly appreciated, thank you. Below, is the latest PHP Scripting file I created and the Web.Config file.

 * Generated configuration file
 * Generated by: phpMyAdmin 4.2.5 setup script
 * Date: Wed, 27 Aug 2014 23:11:32 -0600

/* Servers configuration */
$i = 0;

/* Server: MySQL1 [1] */
$cfg['Servers'][$i]['verbose'] = 'MySQL1';
$cfg['Servers'][$i]['host'] = 'MyHost-IP';
$cfg['Servers'][$i]['port'] = 3306;
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['ssl'] = true;
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = 'Crm';
$cfg['Servers'][$i]['password'] = 'Crm_1964';
$cfg['Servers'][$i]['only_db'] = array('CRM\\_');

/* End of servers configuration */

$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['BZipDump'] = false;
$cfg['RecodingEngine'] = 'none';
$cfg['DefaultLang'] = 'en';
$cfg['OBGzip'] = 0;
$cfg['ForceSSL'] = true;
$cfg['ExecTimeLimit'] = 90;
$cfg['ServerDefault'] = 1;
<?xml version="1.0" encoding="UTF-8"?>
        <add name="MySQL1" connectionString="server=MyHost-IP;database=CRM_;user=Crm;password=Crm_1964;" />

Tom CullenFounder / DeveloperAsked:
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:
I'm confused on what you're looking for... Do you want a classic asp example on how to connect to a mysql solution?
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Well, you have to decide if you want to use .NET or classic asp.  If you go .NET you can use some classic asp inside some <% %> tags but really if you are going .NET  you should be using MVC.  

For classic ASP, you don't need a web.config for your connection string.  You can find connection strings on.... connectionstrings.com http://www.connectionstrings.com/

Below are a couple of connection strings I use.  The top is for sql 2008/20012 and the bottom is for a remote sql server 2005.
conn = "Provider=SQLOLEDB; datasource=localhost; Database=database_name; Uid=user_name; Pwd=password"

con = "Driver={SQL Server};Server=www.someserver.com;Database=database_name; UID=db_username;PWD=db_password

Open in new window

The connection string is in your code and typically in a separate file where you use an include file at the top of your page.  This way, if the connection changes, you change it in one spot.  

IF you have the connection string above in a folder called "conn" and file called connection.asp, then you would include it on every page using
<!--#include virtual="/con/connection.asp"-->

Open in new window

You can use include file instead of virtual.  If you do, and you can use code like below, that means you have parent paths turned on and that is a security issue. If you have iis 7 or above and have not turned on parent paths, nothing to worry about.
<!--#include file="con/connection.asp"-->

Open in new window

If you are just picking this stuff up, you may want to think about a different language.  I love classic asp and it is very easy to use.  According to MS, Windows server 2012 (which supports classic asp) will have an end of life on 2023 http://support.microsoft.com/lifecycle/search/default.aspx?sort=PN&alpha=Windows+server&Filter=FilterNO.    While that is 7yrs away, if your going to need to start thinking of remaking any site in classic asp in the next 3 to 5 years.  I would suggest start looking at PHP as that is an easier step then going to ASP.NET.  Also, if you are trying to break in, you will be in more demand with PHP or another language like .NET, Ruby or Python.
Tom CullenFounder / DeveloperAuthor Commented:
I have tried the basic connection strings where I am using what I used to use:

strConn = "Driver={MySQL ODBC 3.51 Driver};Server=MyISP-Server;Database=CRM_;User=Crm;Password=;Option=3;"
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.Open strConn


I have tried using the ODBC 5.1 Driver as well

First off, let me clarify something here too; Big Money, I am only writing in Classic ASP because an old client I had wanted it in Classic ASP - I could not offer him ASP.Net because I do not have enough practical experience in it YET :) For others, I am trying to teach myself ASP.Net and PHP as well for future relationships. The error I get on my ISP server is the "Internal Server Error 500"

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

When I look at the server logs, it is telling me that there is a misconfiguration with the database server and possibly the Web Server which is IIS 8.

I use to use include files all the time to establish the connection "as listed above" and when I was done I simply would close out the connection. I also used to use IIS 6 and MySQL 4.0. and had no problem connecting to my database and processing data.

So now, I am wondering if there is a security issue or something else in my settings that I am missing. I do not mean to confuse anyone, but it has been probably 5 years since I have been doing this :) sorry. It use to be my passion. Now, I simply want to get back into it and its unfortunate that I am still using Classic ASP.

Thank you for your patience and understanding.

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tom CullenFounder / DeveloperAuthor Commented:
Sigh, my ignorance is a bliss. Scott and Big Money, thank you very much for your time, I went back to review everything, including the server settings. What did I find, I had "checked" the Windows Authentication in the server properties and now I have gained access to my data. D'oh.

I am sorry for wasting your time, but for the future, I will be using this network allot more as I venture into ASP.Net and PHP and hope you folks provide more assistance down the road.

Thank you again and I will transfer each of you equal points here.


Tom Cullen

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
Ray PaseurCommented:
Going forward, this article may be helpful for getting started with PHP.  A lot of it will be redundant for you, but it can steer you toward well-vetted learning resources, and more importantly, steer you away from the many terrible and obsolete examples of PHP code that litter the internet.
Tom CullenFounder / DeveloperAuthor Commented:
Each party gave me lots to think about and it was my own ignorance that brought me here in the first place. BOTH offered helpful support and redirection, I am convinced that I will be perusing ASP.Net and PHP as added Script languages.

Thank you again.

Tom Cullen
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.